-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ingestion/lookml): resolve access notation for LookML Constant #12277
base: master
Are you sure you want to change the base?
feat(ingestion/lookml): resolve access notation for LookML Constant #12277
Conversation
e6de550
to
4ef052f
Compare
4ef052f
to
4a9ec88
Compare
metadata-ingestion/src/datahub/ingestion/source/looker/looker_template_language.py
Outdated
Show resolved
Hide resolved
metadata-ingestion/src/datahub/ingestion/source/looker/lookml_config.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
My only suggestion would be to refactor the logic in resolve_lookml_parameter
into a separate class. Then, the different warning scenarios can be easily unit tested.
def replace_parameters(match): | ||
key = match.group(1) | ||
# Check if it's a misplaced liquid variable | ||
if key in self.source_config.liquid_variable: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should check the lookml_parameter field first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was not done - lookml_constants should take precedence over the manifest file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is old code in newer commits i have removed it already
metadata-ingestion/src/datahub/ingestion/source/looker/looker_template_language.py
Outdated
Show resolved
Hide resolved
metadata-ingestion/src/datahub/ingestion/source/looker/looker_template_language.py
Outdated
Show resolved
Hide resolved
metadata-ingestion/src/datahub/ingestion/source/looker/looker_template_language.py
Show resolved
Hide resolved
710eff2
to
4e7bc94
Compare
Codecov ReportAttention: Patch coverage is
... and 1515 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
metadata-ingestion/src/datahub/ingestion/source/looker/looker_template_language.py
Outdated
Show resolved
Hide resolved
metadata-ingestion/src/datahub/ingestion/source/looker/looker_template_language.py
Outdated
Show resolved
Hide resolved
metadata-ingestion/src/datahub/ingestion/source/looker/lookml_config.py
Outdated
Show resolved
Hide resolved
metadata-ingestion/src/datahub/ingestion/source/looker/lookml_source.py
Outdated
Show resolved
Hide resolved
...a-ingestion/tests/integration/lookml/vv-lineage-and-liquid-templates/activity_logs.view.lkml
Outdated
Show resolved
Hide resolved
@@ -869,11 +869,15 @@ def test_view_to_view_lineage_and_liquid_template(pytestconfig, tmp_path, mock_t | |||
"dev_database_prefix": "employee", | |||
"dev_schema_prefix": "public", | |||
}, | |||
"_dev_database_attributes": { | |||
"dev_database_prefix": "customer", | |||
}, | |||
"dw_eff_dt_date": { | |||
"_is_selected": True, | |||
}, | |||
"source_region": "ap-south-1", | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need some unit tests focused specifically on LookmlConstantTransformer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where are the unit tests? we have full integration tests for this, but we should really have a more targeted unit test that creates a LookmlConstantTransformer
and tests its behavior in isolation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't resolve comments if things aren't actually resolved. If you're unsure if you've done what was asked for, leave the comment unresolved and I can take another look.
def replace_parameters(match): | ||
key = match.group(1) | ||
# Check if it's a misplaced liquid variable | ||
if key in self.source_config.liquid_variable: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was not done - lookml_constants should take precedence over the manifest file
metadata-ingestion/src/datahub/ingestion/source/looker/lookml_config.py
Outdated
Show resolved
Hide resolved
@@ -869,11 +869,15 @@ def test_view_to_view_lineage_and_liquid_template(pytestconfig, tmp_path, mock_t | |||
"dev_database_prefix": "employee", | |||
"dev_schema_prefix": "public", | |||
}, | |||
"_dev_database_attributes": { | |||
"dev_database_prefix": "customer", | |||
}, | |||
"dw_eff_dt_date": { | |||
"_is_selected": True, | |||
}, | |||
"source_region": "ap-south-1", | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where are the unit tests? we have full integration tests for this, but we should really have a more targeted unit test that creates a LookmlConstantTransformer
and tests its behavior in isolation
Hi @hsheth2, |
Checklist