-
Notifications
You must be signed in to change notification settings - Fork 161
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
[ADAP-501] [Feature] Leverage Bigquery Comments at Model level #685
Comments
+1 Present behavior is not consistent across adapters; it should be. Also, the diction of "query comment" is confusing for folks looking for query labels (not comments). Hence, following this design makes the capability more accessible. As mentioned by the author, the scope of change should be limited to the config override. Thus, no job-label flag override should be required within |
Nice proposal and insights @matt-winkler and @algarbar 🤩 How do you see this as similar to or different from the
Keen to hear more @algarbar -- what do you think we should do to make it more consistent? |
@dbeatty10 - Spot on; it is quite similar. Key distinctions result due to data platform design. Snowflake's query_tag is a string limited to 2000 characters. Often this is input in JSON format for variant casting. BigQuery enables query_labels as {K,V} pairs accessed through an array of structs (E.G. see JOBS_BY_USER). Thus a dbt Snowflake's model would implement RE adapter consistency: dbt-snowflake presently implements Snowflake's |
Thanks for this info @algarbar ! Refining the behavior@matt-winkler and @algarbar: Would you see the implementation of this feature as the following?
|
Thank you @dbeatty10 -
|
🙏 Thanks for all the helpful responses @algarbar ! Interested to hear your thoughts @matt-winkler, especially as it relates to query comments since that seemed to be your motivating use case. |
Hey @dbeatty10 I think it makes good sense to have an interface on the BQ side (without requiring the end user to override / set custom macros), such that the experience is similar to snowflake. The function of this in BQ is similar enough / the same as on Snowflake that we should just do it. |
We need to do a little more refining on this before we can specify the acceptance criteria. @matt-winkler does the following sound like your overall intent and key exit criteria? The overall intent:
Acceptance criteria:
|
@dbeatty10 yes, and also we should make sure that this behavior supports analyzing jobs by label in the jobs_by_user view. |
@dbeatty10 I think the above is what's needed from an end user perspective. I'd propose the following as additional AC:
Any reason not to go ahead and start a PR? |
Consider: PR379 proposes PR to also include query_comment (good suggestion above from @dbeatty10). Any other consideration? |
@dbeatty10 Would love your thoughts on requirements / where we go from here. |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days. |
Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers. |
Is this your first time submitting a feature request?
Describe the feature
Related to 3145, current functionality is documented here
Currently, users can specify query comments OOB using a config in the
dbt_project.yml
:It's also straightforward to use a custom macro in the
comment
field which can read arbitrary configs on each model, an update the comment string accordingly.This pattern is highly desirable from a cost-tracking perspective with bigquery. The configs here seem fairly straightforward to implement, so we should add this to dbt-core instead of asking users to do it. The goal is to enable users to only specify
{{config(query_labels={"k1": "v1", "k2": "v2"})}}
instead of having to override the built inquery_comment
macro.This should also work on tests.
Describe alternatives you've considered
Continue forcing users to override the built-in.
Who will this benefit?
All dbt-bigquery users.
Are you interested in contributing this feature?
Yes
Anything else?
No response
The text was updated successfully, but these errors were encountered: