-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Unit Tests for Compiler #1624
Unit Tests for Compiler #1624
Conversation
@beckjake @drewbanin . The tests are failing on one single postgres test, which I don't quite understand. I've just pushed some extra debug logging to see if that lends some more clarity. It looks like something unexpected is being passed through in the new |
@beckjake - ok, postgres tests are passing now, I've ignored macros when considering whether to use relative referencing. Can you guys think of any cases where that might cause issues? Can we test the changes against the other integration targets? |
Hey @alanmcruickshank - I was writing a followup on the issue thread, but you beat me to the punch with this PR! I just want to say: the code you wrote here looks really slick! I applaud you biasing towards action, and I'm super impressed that you were able to get something working at all in one of the more complex parts of the dbt codebase! I'll also say: my instinct is that getting configs involved here is probably more trouble than it's worth. I also think that the workflow you're making possible with this code is super Snowflake-specific, so it might turn out that So, in all, my instinct is to make this functionality addressable in user-space (or at least, plugin-space). I think a good path forwards involves letting users implement their own @beckjake definitely feel free to chime in if you have any strong thoughts - I don't need to have the last word here - I'm very happy to be wrong, now and always :) Thanks again for the really slick PR @alanmcruickshank - looking forward to hearing what you think! |
Interesting idea. I hear the point about it being snowflake specific, so perhaps to make it pluginnable. I'd rather patch the ref function, than go down the macros route, but I'll take a look at the plugin architecture to see what could be possible... Have you got any examples in the existing codebase where we patch things for specific adapters? |
Heya guys, I've moved the logic out of the core app, and into the snowflake plugin. That means I've also separated the tests. I'm in the process of setting up some integration tests with our snowflake credentials to check that all that works in practice too. In the mean time:
The only other option I could think of would be patching the context for the snowflake adapter, but that sounds like it just makes the problems from #1255 even worse. |
Thanks @alanmcruickshank - I'll take a look at this later today! |
Thanks @drewbanin - maybe don't merge it yet. The integration tests have brought up some more wrinkles. Would still appreciate your thoughts on how it's architecturally put together. |
Hey @alanmcruickshank - you mentioned above:
Can you say more about why you'd prefer not to go down the macros route? I really think that letting users override In the interest of being very direct: I'd have a really hard time merging code that looks approximately like what you've pushed up here. I think these commits are really nice-looking, thoughtful, and well-architected, but I also think that your general approach here does not represent the "dbt way" of doing things. I am very unopinionated on the code quality aspect of this discussion -- I care a lot more about the experience for end-users of dbt. Please feel very free to keep pushing commits (I'm happy to keep taking a look at them) but I wanted to give you a super clear idea of my current thinking around this PR. Let me know your thoughts around leveraging macros here. I'll give this some more though too. Looking forward to discussing! |
63b8c37
to
59aa745
Compare
@drewbanin I'll take a look at the macros. The reason I didn't want to go down that route initially was that introducing a new command (e.g. Being able to patch things by default like I've amended the pull request to just include the unit tests for the compiler - which are hopefully still of use. Assuming they pass, can you merge them so they don't go stale? I'll submit the macro extensions as a seperate PR. |
I've renamed this PR, and I'm going to move the discussion back to the original issue #1603 |
Hey @alanmcruickshank - this PR is pretty outdated anymore. I'm going to close it out, but happy to reopen if there's still merit to getting these unit tests merged! I think though that these cases are adequately tested by other parts of the existing test suite. |
This resolves issue #1603
Add the
relative-ref
functionality.select * from {{ ref('root_table_a', relative=True) }}
'relative_ref': True
@drewbanin @beckjake I've run this through the unit tests (and added a load more unit tests for the compiler so that we can test other functionality), but I've not run it through the full test suite because I don't have access to all the infrastructure. Any chance one of you guys could kick this off through the full test suite to check it's all good?