rittmananalytics / droughty

Droughty helps keep your workflow dry
https://droughty.readthedocs.io/en/latest/
MIT License
62 stars 6 forks source link

Surface Looker Explore prod/dev datasets in the SQL pane #76

Open jilyat opened 7 months ago

jilyat commented 7 months ago

Would it be possible to generate a customisable LookML line of code (specified in the droughty_project.yaml file) beneath each view in the _base.layer.lkml file, in this instance to enable custom prod and development datasets to be surfaced in the Looker Explore SQL pane?

_base.layer.lkml example

view: { sql_table_name: `<gcp_project_id>.{{ _user_attributes['<user_attribute_analytics_data_warehouse>'] }}.<data_warehouse_table_name>` ;;

drought_project.yaml

lookml_dataset: sql_table_name: `<gcp_project_id>.{{ _user_attributes['<user_attribute_analytics_data_warehouse>'] }}.<data_warehouse_table_name>` ;;

This would enable users to investigate queries in the data warehouse UI if needed, or check if the user is querying against production or development data.