Skip to content

parameter pass to @dag() decorators are not functioning #19532

@wuchichung

Description

@wuchichung

Apache Airflow version

2.1.3

Operating System

linux

Versions of Apache Airflow Providers

No response

Deployment

Docker-Compose

Deployment details

No response

What happened

I test with the max_active_runs parameters and I set it to 1.

If I pass the param through @dag() decorator, it is not going to work.

default_args = {
"owner": "cloud",
"depends_on_past": False,
"start_date": datetime(2020, 1, 1),
"provide_context": True,
"retries": 0,
"queue": CLOUD_CELERY_WORKER_Q,
"max_active_runs": 1,
}
@dag(dag_id=DAG_ID, default_args=default_args, schedule_interval=timedelta(minutes=1))
def my_dummy_dag():
pass

HOWEVER, if I set it directly like the following, it works.
d = my_dummy_dag()
d.max_active_runs = 1

What you expected to happen

It should not make any difference between this two methods.

How to reproduce

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

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions