Skip to content

asset alias example dag is failing with Direct database access via the ORM is not allowed in Airflow 3.0 #47483

@rawwar

Description

@rawwar

Apache Airflow version

main (development)

If "Other Airflow 2 version" selected, which one?

No response

What happened?

example dag_id asset_alias_example_alias_producer defined in example_asset_alias.py is failing with below error:

Traceback (most recent call last):
  File "/opt/airflow/airflow/utils/session.py", line 40, in create_session
    session = Session()
  File "/opt/airflow/task-sdk/src/airflow/sdk/execution_time/supervisor.py", line 207, 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

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/airflow/airflow/serialization/serialized_objects.py", line 1768, in to_dict
    json_dict = {"__version": cls.SERIALIZER_VERSION, "dag": cls.serialize_dag(var)}
  File "/opt/airflow/airflow/serialization/serialized_objects.py", line 1682, in serialize_dag
    raise SerializationError(f"Failed to serialize DAG {dag.dag_id!r}: {e}")
airflow.exceptions.SerializationError: Failed to serialize DAG 'asset_alias_example_alias_producer': Direct database access via the ORM is not allowed in Airflow 3.0

What you think should happen instead?

No response

How to reproduce

breeze start-airflow --load-example-dags

Operating System

Mac

Versions of Apache Airflow Providers

No response

Deployment

Other

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions