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 parameters #12172

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

Conversation

sid-acryl
Copy link
Contributor

No description provided.

@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Dec 19, 2024
@datahub-cyborg datahub-cyborg bot added the needs-review Label for PRs that need review from a maintainer. label Dec 19, 2024
@@ -873,6 +873,7 @@ def test_view_to_view_lineage_and_liquid_template(pytestconfig, tmp_path, mock_t
"_is_selected": True,
},
"source_region": "ap-south-1",
"star_award_winner_year": "public.winner_2025",
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this also a liquid variable? or is it something else?

We should also add some docs around the liquid variable resolution functionality

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The parameter field, as described in the Looker documentation, is used to define variables accessible within Liquid templates using {% ... %} or {{ ... }} syntax. If no complex conditions need to be evaluated, these parameters can also be directly referenced in LookML views using the @{ ... } notation.

For example:

  • sql_table_name: @{star_award_winner_year}
  • sql_table_name: {% if user_attribute('use_schema') == 'true' %} {{ star_award_winner_year }} {% else %} public.winner_2024 {% endif %} ;;

The key difference between @{ ... } and using a Liquid template is that Liquid allows access to additional user-related attributes, while @{ ... } only references parameters defined in the parameter attribute of the view.

The attribute name liquid_variable in recipe is bit confusing. We can rename it to lookml_parameter, then it wouldn't convey the dynamic nature of liquid template. I can add additional documentation to liquid_variable or you can suggest some other name

@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 Dec 19, 2024
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 pending-submitter-response Issue/request has been reviewed but requires a response from the submitter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants