-
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
BaseOperator.get_task_instances is broken due to order by TaskInstance.execution_date #20116
Comments
This is meant to be a backwards compatibility shim, so that Can you provide a reproduction case for this? |
@ashb I have updated the "How to reproduce" section with a reproducible snippet. |
Not really, the function has not been touched (except to apply Black) in three years, and is not used at all in the code base, and therefore alluded attention during the Feel free to submit a pull request for this. The fix should join DagRun on TaskInstance on |
Oh, we updated DAG.get_task_instances, but forgot to update BaseOperator.get_task_instances as well |
Duplicate of #21656 issue was fixed in #21705 Noting that the reproduce example provided will not work even now. airflow/airflow/models/baseoperator.py Lines 1242 to 1243 in c23b31c
The DAG
Will yield:
You can change it to: |
Apache Airflow version
2.2.2 (latest released)
What happened
I was trying to call
task.get_task_instances()
but received an errorsqlalchemy.exc.ArgumentError: SQL expression object expected, got object of type <class 'sqlalchemy.ext.associationproxy.ColumnAssociationProxyInstance'> instead
.Looking at the code, it's trying to order by
TaskInstance.execution_date
which is an association proxy. https://sourcegraph.com/github.com/apache/airflow@944dcfb/-/blob/airflow/models/baseoperator.py?L1252:21If I remove the order_by clause, the function would work.
What you expected to happen
The function to return a list of TaskInstance objects
How to reproduce
Operating System
Debian GNU/Linux
Versions of Apache Airflow Providers
No response
Deployment
Other Docker-based deployment
Deployment details
No response
Anything else
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: