-
Notifications
You must be signed in to change notification settings - Fork 14.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
SQLCheckOperator fails if it returns dict with any Falsy values #36273
SQLCheckOperator fails if it returns dict with any Falsy values #36273
Conversation
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
|
3b961ad
to
dad720e
Compare
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.
For me, it's a bug fix, and there is no breaking change. LGTM
cc: @eladkal
d6f61c2
to
cc125ac
Compare
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
closes: #34794
This PR modifys the SQLCheckOperator's behaviour in how it handles reading a Python
dict
.Previously, if a Python
dict
was returned by the SQL query, the SQLCheckOperator would always pass. As suggested in the linked issue, if a Pythondict
is returned it is recommended that if any of the dict's values are False-y , then the Operator should fail. This PR makes that change.For example, if the SQL query being tested returns:
then the operator should return False, since there is a Falsy value present.
The PR also adds an additional unit test and updated the documentation of the Operator.
Question for reviewers: I am concerned that users may be implementing this operator under the assumption that any
dict
returned means the task should pass. With this change, that would now lead to the task failing.