airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <>
Subject [jira] [Commented] (AIRFLOW-1606) DAG.sync_to_db is static, but takes a DAG as first argument
Date Wed, 13 Sep 2017 13:26:07 GMT


ASF subversion and git services commented on AIRFLOW-1606:

Commit 6ac2963fb4bf61774ed856ed7f0a922acf9487be in incubator-airflow's branch refs/heads/master
from [~bolke]
[;h=6ac2963 ]

[AIRFLOW-1606] Use non static DAG.sync_to_db

Finalizes refactor where one line was missed.

Closes #2606 from bolkedebruin/AIRFLOW-1606

> DAG.sync_to_db is static, but takes a DAG as first argument
> -----------------------------------------------------------
>                 Key: AIRFLOW-1606
>                 URL:
>             Project: Apache Airflow
>          Issue Type: Bug
>            Reporter: Ash Berlin-Taylor
>            Assignee: Ash Berlin-Taylor
>            Priority: Minor
>             Fix For: 1.9.0
> As discussed,
airflow.models.DAG.sync_to_db is declared as a static method, but it takes as it's first argument
a DAG object (i.e. the same class that the method is delcared on). This is a bit odd.
> There are two uses. One in utils/
> {code}
>     for dag in dagbag.dags.values():
>         models.DAG.sync_to_db(dag, dag.owner, now)
> {code}
> This would make more sense as {{dag.sync_to_db(synctime=now)}}. The other use is inside
this method itself:
> {code}
>         for subdag in dag.subdags:
>             DAG.sync_to_db(subdag, owner, sync_time, session=session)
> {code}
> which could be become {{subdag.sync_to_db(sync_time=sync_time, session=session)}}

This message was sent by Atlassian JIRA

View raw message