fix: support dbt Core 1.10+ arguments: keyword in unique_combination_of_columns#1077
Open
Hitendrasinhdata7 wants to merge 2 commits intodbt-labs:mainfrom
Open
Conversation
Contributor
|
Which patch version of dbt 1.10 are you using? Please make sure you have the latest patch installed (v1.10.20) as I believe this is unnecessary. |
…f_columns - Add kwargs.get() fallback for combination_of_columns and quote_columns - Handle nested 'args'/'arguments' keys for future compatibility - Add integration tests for both old and new syntax
Author
|
I've verified the issue still exists in dbt Core 1.10.20. My updated fix uses kwargs.get() and handles nested args/arguments keys. Integration tests pass with both old and new syntax. The FAIL 1 in my local test is expected because the test data contains duplicates – proving the macro works correctly. Please review again. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1058
Problem
Users on dbt Core 1.10+ get this compilation error when using
the
arguments:keyword wrapper withunique_combination_of_columns:macro 'dbt_macro__test_unique_combination_of_columns'
takes no keyword argument 'arguments'
Root Cause
dbt Core 1.10+ passes test arguments as
kwargswhen using thearguments:keyword wrapper. The macro was not reading fromkwargs.Fix
Added
kwargs.get()calls so both syntaxes work correctly.Testing
Added integration test covering new
arguments:syntax.Both old and new syntax pass:
Old syntax (dbt < 1.10)
New syntax (dbt >= 1.10)