airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bolke de Bruin (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (AIRFLOW-1606) DAG.sync_to_db is static, but takes a DAG as first argument
Date Wed, 13 Sep 2017 11:30:00 GMT

     [ https://issues.apache.org/jira/browse/AIRFLOW-1606?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Bolke de Bruin resolved AIRFLOW-1606.
-------------------------------------
       Resolution: Fixed
    Fix Version/s: 1.9.0

Issue resolved by pull request #2605
[https://github.com/apache/incubator-airflow/pull/2605]

> DAG.sync_to_db is static, but takes a DAG as first argument
> -----------------------------------------------------------
>
>                 Key: AIRFLOW-1606
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-1606
>             Project: Apache Airflow
>          Issue Type: Bug
>            Reporter: Ash Berlin-Taylor
>            Assignee: Ash Berlin-Taylor
>            Priority: Minor
>             Fix For: 1.9.0
>
>
> As discussed https://github.com/apache/incubator-airflow/pull/2602/files#r138567736,
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/db.py:
> {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
(v6.4.14#64029)

Mime
View raw message