Direct database access via the ORM is not allowed in Airflow 3.0, when trying to clean XCom inside a DAG #50944
Closed
1 of 2 tasks
Labels
area:core
kind:bug
This is a clearly a bug
needs-triage
label for new issues that we didn't triage yet
Uh oh!
There was an error while loading. Please reload this page.
Apache Airflow version
3.0.1
If "Other Airflow 2 version" selected, which one?
No response
What happened?
Hi,
normally I am cleaning up at the end of each DAG execution the DAG XCom's. I have now upgraded to the newest Airflow 3.0.1 version and found that this is not any more possible because of the following restriction: Direct database access via the ORM is not allowed in Airflow 3.0
Normally I was using the following code to clean up the XCom's:
Now I have tried also this one, which is based on the official XCom Documentation :
Still getting the same error and my DAG fails.
I am quite sure that, my first approach was not the best one, because I was querying and deleting elements directly, which I though is the problem. When I tested with the XComModel.clear() function and still getting the same error, I expected it to work, because it is a predefined function and the user passes only the required arguments, which is not so harmful.
What you think should happen instead?
I think there should be definitely a way, how the people can delete their XCom's inside a DAG and the XComModel.clear() function should have probably an exclusion for this new restriction, which forbites the direct db access via ORM.
How to reproduce
Just execute the following in any DAG:
Operating System
Red Hat Enterprise Linux 8.10 (Ootpa)
Versions of Apache Airflow Providers
No response
Deployment
Other Docker-based deployment
Deployment details
I am running Airflow 3.0.1 with KubernetesExecutor on Openshift
Anything else?
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: