You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Leon-Sander (via GitHub)" <gi...@apache.org> on 2025/06/13 07:37:15 UTC

[D] Direct database access via the ORM is not allowed in Airflow 3.0 [airflow]

GitHub user Leon-Sander created a discussion: Direct database access via the ORM is not allowed in Airflow 3.0

The following error seems to be produced by the function

```
from airflow.models import DagRun
DagRun.find(dag_id=dag_id)
```

```
Traceback (most recent call last):
  File "/home/airflow/.local/lib/python3.12/site-packages/airflow/utils/session.py", line 41, in create_session
    session = Session()
              ^^^^^^^^^
  File "/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/execution_time/supervisor.py", line 258, in __init__
    raise RuntimeError("Direct database access via the ORM is not allowed in Airflow 3.0")
RuntimeError: Direct database access via the ORM is not allowed in Airflow 3.0
```

How else do I need to call this to not get the error?


GitHub link: https://github.com/apache/airflow/discussions/51680

----
This is an automatically sent email for commits@airflow.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@airflow.apache.org


Re: [D] Direct database access via the ORM is not allowed in Airflow 3.0 [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
GitHub user potiuk added a comment to the discussion: Direct database access via the ORM is not allowed in Airflow 3.0

Not being able to access DB is a feature of Airflow 3. For  a long time DB has not been part of the public interface of Airflow - and Airflow 3 finally cut the access. 

You can use REST API an Python client instead if you want to access information from Aiflow Metadata DB.


GitHub link: https://github.com/apache/airflow/discussions/51680#discussioncomment-13458967

----
This is an automatically sent email for commits@airflow.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@airflow.apache.org


Re: [D] Direct database access via the ORM is not allowed in Airflow 3.0 [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
GitHub user potiuk added a comment to the discussion: Direct database access via the ORM is not allowed in Airflow 3.0

See also discussion here https://github.com/apache/airflow/issues/51563 and you can chime in there.

GitHub link: https://github.com/apache/airflow/discussions/51680#discussioncomment-13458979

----
This is an automatically sent email for commits@airflow.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@airflow.apache.org