-
Notifications
You must be signed in to change notification settings - Fork 14.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
Add Snowflake DQ Operators #17741
Merged
Merged
Add Snowflake DQ Operators #17741
Changes from 4 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
52379c4
Add three new Snowflake operators based on SQL Checks
denimalpaca 7b105a0
Create tests for new Snowflake Operators
denimalpaca 32ba33f
Merge branch 'apache:main' into snowflake_dq_operators
denimalpaca 58b673f
Remove legacy SQL parameters (17741)
denimalpaca 76f7086
Update airflow/providers/snowflake/operators/snowflake.py
mik-laj 945b766
Merge branch 'apache:main' into snowflake_dq_operators
denimalpaca af7419f
Make code more DRY by having all classes use hook mixin class
denimalpaca 333b45c
Update SnowflakeValueCheckOperator docstring
denimalpaca b541c3c
Merge branch 'apache:main' into snowflake_dq_operators
denimalpaca 9ef28b3
Modify SnowflakeOperator to use get_db_hook and update test
denimalpaca a2f74cd
Merge branch 'apache:main' into snowflake_dq_operators
denimalpaca e3c82bb
Removes Snowflake Mixin Class
denimalpaca File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
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.
Why a class and not just a method inside the SnowflakeCheckOperator?
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.
Good point
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.
Trying to be more DRY. Originally I tried making the
Check
classes inherit from just theSnowflakeOperator
, but it resulted in an error in the constructors.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.
DRY philosophy is great. However, my point was that you don't need a class at all and you can get rid of the class extra layer of abstraction. My comment is inspired by https://www.youtube.com/watch?v=o9pEzgHorH0
Using the same class too in the SnowflakeOperator has been quite an improvement, but I think you can still have just a function in the file, and you can just call it from the operators. Anyway, it's not a big deal and the PR is already approved, so up to u.
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.
I wached the presentation :). Entertaining and I mostly agree with it (not everything :)
But yeah - in this case using mixin is definitely over-the-top.
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.
Would you mind changing that @denimalpaca ?
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.
Will have this fixed Tuesday, looks like with the way BaseSQLOperator works, even the function without a class might not be necessary.