Skip to content

get_parsing_context().dag_id is not set when using airflow dags test command #37483

@hterik

Description

@hterik

Apache Airflow version

Other Airflow 2 version (please specify below)

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

2.7.1

What happened?

When trying to use airflow dags test my_parameterized_dag, i expect get_parsing_context().dag_id to be set, so that the local test-environment resembles production as closely as possible, and to save dag parsing time in my local test executions.

What you think should happen instead?

Right now, get_parsing_context().dag_id returns None instead

How to reproduce

See above

Operating System

Ubuntu 23.10

Versions of Apache Airflow Providers

No response

Deployment

Other

Deployment details

No response

Anything else?

Documented in https://airflow.apache.org/docs/apache-airflow/stable/howto/dynamic-dag-generation.html#optimizing-dag-parsing-delays-during-execution

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions