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

test macro: set model_node_being_tested before caller() instead of after #218

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

alexzorin
Copy link
Contributor

Part of the use case for #210 was to be able to build up queries in the dbt_unit_testing.test() block using model metadata, e.g. the columns list.

I am noticing that sometimes model_node_being_tested is not set at the execution time of caller(). For some of our models it is fine, for some it isn't. I am not sure what the difference is.

Was there a reason that the context is only being set after caller()? Is there any harm in doing it earlier like proposed in this PR?

Copy link
Collaborator

@psousa50 psousa50 left a comment

Choose a reason for hiding this comment

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

It makes total sense! 👍

Thank you!

@psousa50 psousa50 added the safe to test Label used to identify prs safe to test on the integration environments label Jul 23, 2024
@github-actions github-actions bot removed the safe to test Label used to identify prs safe to test on the integration environments label Jul 23, 2024
@psousa50 psousa50 merged commit 5e9553d into EqualExperts:master Jul 23, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants