Skip to content
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

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

sagar-salvi-apptware
Copy link
Contributor

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@sagar-salvi-apptware sagar-salvi-apptware changed the title lookml parameter support feat(ingestion/lookml): resolve access notation for LookML parameters Jan 6, 2025
@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Jan 6, 2025
@sagar-salvi-apptware sagar-salvi-apptware marked this pull request as ready for review January 8, 2025 11:14
@sagar-salvi-apptware sagar-salvi-apptware force-pushed the fix/ING-784-lookml-parameter branch from e6de550 to 4ef052f Compare January 8, 2025 11:18
@sagar-salvi-apptware sagar-salvi-apptware force-pushed the fix/ING-784-lookml-parameter branch from 4ef052f to 4a9ec88 Compare January 8, 2025 11:20
@datahub-cyborg datahub-cyborg bot added the needs-review Label for PRs that need review from a maintainer. label Jan 8, 2025
@datahub-cyborg datahub-cyborg bot added pending-submitter-response Issue/request has been reviewed but requires a response from the submitter and removed needs-review Label for PRs that need review from a maintainer. labels Jan 8, 2025
@datahub-cyborg datahub-cyborg bot added needs-review Label for PRs that need review from a maintainer. pending-submitter-response Issue/request has been reviewed but requires a response from the submitter and removed pending-submitter-response Issue/request has been reviewed but requires a response from the submitter needs-review Label for PRs that need review from a maintainer. labels Jan 8, 2025
Copy link
Contributor

@sgomezvillamor sgomezvillamor left a 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:
Copy link
Collaborator

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

Copy link
Collaborator

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

Copy link
Contributor Author

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

Copy link

codecov bot commented Jan 10, 2025

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ngestion/source/looker/looker_template_language.py 80.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
...ahub/ingestion/source/looker/looker_dataclasses.py 83.48% <ø> (ø)
...ahub/ingestion/source/looker/looker_file_loader.py 79.59% <ø> (-0.41%) ⬇️
...c/datahub/ingestion/source/looker/lookml_config.py 93.00% <ø> (-0.07%) ⬇️
...c/datahub/ingestion/source/looker/lookml_source.py 79.28% <ø> (+0.21%) ⬆️
...ngestion/source/looker/looker_template_language.py 93.70% <80.00%> (+1.45%) ⬆️

... and 1515 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 842c8f9...f1daf12. Read the comment docs.

@datahub-cyborg datahub-cyborg bot removed the pending-submitter-response Issue/request has been reviewed but requires a response from the submitter label Jan 10, 2025
@datahub-cyborg datahub-cyborg bot added needs-review Label for PRs that need review from a maintainer. and removed pending-submitter-response Issue/request has been reviewed but requires a response from the submitter labels Jan 15, 2025
metadata-ingestion/docs/sources/looker/lookml_post.md 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",
}
Copy link
Collaborator

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

Copy link
Collaborator

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

Copy link
Contributor Author

@sagar-salvi-apptware sagar-salvi-apptware Jan 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @hsheth2 this is old code new commits will have new test for lookml constant.
0b54bb6

@datahub-cyborg datahub-cyborg bot added pending-submitter-response Issue/request has been reviewed but requires a response from the submitter and removed needs-review Label for PRs that need review from a maintainer. labels Jan 16, 2025
@sagar-salvi-apptware sagar-salvi-apptware changed the title feat(ingestion/lookml): resolve access notation for LookML parameters feat(ingestion/lookml): resolve access notation for LookML Constant Jan 16, 2025
@datahub-cyborg datahub-cyborg bot added needs-review Label for PRs that need review from a maintainer. and removed pending-submitter-response Issue/request has been reviewed but requires a response from the submitter labels Jan 16, 2025
@datahub-cyborg datahub-cyborg bot added pending-submitter-response Issue/request has been reviewed but requires a response from the submitter and removed needs-review Label for PRs that need review from a maintainer. labels Jan 17, 2025
@datahub-cyborg datahub-cyborg bot added needs-review Label for PRs that need review from a maintainer. and removed pending-submitter-response Issue/request has been reviewed but requires a response from the submitter labels Jan 17, 2025
Copy link
Collaborator

@hsheth2 hsheth2 left a 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.

metadata-ingestion/docs/sources/looker/looker_recipe.yml Outdated Show resolved Hide resolved
def replace_parameters(match):
key = match.group(1)
# Check if it's a misplaced liquid variable
if key in self.source_config.liquid_variable:
Copy link
Collaborator

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

@@ -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",
}
Copy link
Collaborator

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

@datahub-cyborg datahub-cyborg bot added pending-submitter-response Issue/request has been reviewed but requires a response from the submitter and removed needs-review Label for PRs that need review from a maintainer. labels Jan 17, 2025
@sagar-salvi-apptware
Copy link
Contributor Author

Hi @hsheth2,
In the newer commits all changes has been cover except liquid_variable -> liquid_variables as it was existing field dont want to rename it but i ll rename this also

@datahub-cyborg datahub-cyborg bot added needs-review Label for PRs that need review from a maintainer. and removed pending-submitter-response Issue/request has been reviewed but requires a response from the submitter labels Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ingestion PR or Issue related to the ingestion of metadata needs-review Label for PRs that need review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants