[ 
https://issues.apache.org/jira/browse/AIRFLOW-1606?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16164642#comment-16164642
 ] 

ASF subversion and git services commented on AIRFLOW-1606:
----------------------------------------------------------

Commit 6ac2963fb4bf61774ed856ed7f0a922acf9487be in incubator-airflow's branch 
refs/heads/master from [~bolke]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;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: 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)

Reply via email to