-
Notifications
You must be signed in to change notification settings - Fork 178
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
[Bug] Fix scenarios where --empty
flag pushes limit 0
into metadata queries
#1100
Conversation
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the dbt-snowflake contributing guide. |
--empty
flag pushes limit 0
into metadata queries
"truncate_relation", | ||
], | ||
) | ||
def test_run(self, project, model): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these tests pass even without fixing {{ relation }}
to be {{ relation.render() }}
. I think it has something to do with whether the template returns just the sql or whether it does the call. I added the tests in case this changes in the future, and updated the macros to use {{ relation.render() }}
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of this will move into dbt-tests-adapter
and then imported here afterwards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good to me
@mikealfare When might one expect these change in a release? Or is there a way to test these changes on our system before a release? |
I will ask my question to a larger audience: @colin-rogers-dbt @McKnight-42 @jtcohen6 When might one expect these change in a release? Or is there a way to test these changes on our system before a release? |
…ta queries (#1100) (#1204) * fix get_columns_in_relation * add render to relation in other metadata queries * add tests for all render instances (cherry picked from commit 13970da) Co-authored-by: Mike Alfare <[email protected]>
resolves #1033
Problem
We use
{{ relation }}
to render the relation name in metadata queries. However, we implemented the--empty
flag to addlimit 0
when{{ relation }}
is used. We wind up with queries like:which is not valid sql.
Solution
{{ relation.render() }}
in these scenarios (there are many)--empty
flagImplementation
dbt-tests-adapter
dbt-tests-adapter
testsChecklist