-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Feature] Make sql_header
configuration available on tests
#9775
Comments
@epapineau ! So good to see you 😄 Are you thinking primarily data tests or unit tests or both? If data tests is included, singular or generic or both? Could you share a simplified code example in which you'd want to define a temporary BigQuery UDF and a test that would use it? |
Data tests! And probably both singular and generic - can't imagine having the ability in one and not the other |
I've been working with the temporary UDF recommended here this week. I'm creating a temporary UDF using |
Something more explicit would be great! It would serve as a two-fer-one:
|
Okay, here's an example using the UDF from the article linked above to get keys and values from JSON. In this example, I want the test to fail where
|
Thanks for that example @epapineau ! I tried out your example, and surprising it works if (and only if) Regardless, it makes sense for us to do the following:
I did a proof-of-concept in these draft PRs: Labeling this as |
@dbeatty10 hi! Could i take your draft PRs?
|
@dbeatty10 |
There is a patch for this at https://takemikami.com/2024/0921-dbt-bigquery-sql-header.html. It worked well when I tried it. I wonder what it would take to get it into the release. |
Is this your first time submitting a feature request?
Describe the feature
The
sql_header
model configuration is a convenient way to define a temporary BigQuery UDF, as described in the dbt docs. It would be helpful to have this configuration available on tests as well for the same purposes.Describe alternatives you've considered
No response
Who will this benefit?
No response
Are you interested in contributing this feature?
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: