Skip to content

Fix BaseOperator get_task_instances query#33054

Merged
hussein-awala merged 2 commits into
apache:mainfrom
hussein-awala:fix_get_tis
Aug 3, 2023
Merged

Fix BaseOperator get_task_instances query#33054
hussein-awala merged 2 commits into
apache:mainfrom
hussein-awala:fix_get_tis

Conversation

@hussein-awala

Copy link
Copy Markdown
Member

This PR fixes the query of BaseOperator.get_task_instances method which accept None start and end dates, where when we provide a None start_date (the default value), we get the following exception:

sqlalchemy.exc.ArgumentError: Only '=', '!=', 'is_()', 'is_not()', 'is_distinct_from()', 'is_not_distinct_from()' operators can be used with None/True/False

^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@hussein-awala
hussein-awala requested a review from uranusjr as a code owner August 2, 2023 22:06

@potiuk potiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe a test for that one?

@eladkal eladkal added this to the Airflow 2.7.1 milestone Aug 3, 2023
@eladkal eladkal added the type:bug-fix Changelog: Bug Fixes label Aug 3, 2023
Comment thread airflow/models/baseoperator.py
@hussein-awala

Copy link
Copy Markdown
Member Author

@potiuk @amoghrajesh could you take a second look?

@potiuk

potiuk commented Aug 3, 2023

Copy link
Copy Markdown
Member

LGTM

@hussein-awala
hussein-awala merged commit f5a83bc into apache:main Aug 3, 2023
ephraimbuddy pushed a commit that referenced this pull request Aug 4, 2023
* Fix BaseOperator get_task_instances query

* add unit test

(cherry picked from commit f5a83bc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants