You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Winty (JIRA)" <ji...@apache.org> on 2017/11/02 11:58:00 UTC

[jira] [Comment Edited] (AIRFLOW-1773) [Mark Success] not work in UI

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

Winty edited comment on AIRFLOW-1773 at 11/2/17 11:57 AM:
----------------------------------------------------------

I solve problem. just remove a line

airflow / api / common / experimental / mark_tasks.py
{code:python}

def set_state(task, execution_date, upstream=False, downstream=False,              future=False, past=False, state=State.SUCCESS, commit=False):
...
    # microseconds are supported by the database, but is not handled
    # correctly by airflow on e.g. the filesystem and in other places    
    # execution_date = execution_date.replace(microsecond=0) # I remove this code
...
{code}



was (Author: winty):
I solve problem. jut

airflow / api / common / experimental / mark_tasks.py
{code:python}

def set_state(task, execution_date, upstream=False, downstream=False,              future=False, past=False, state=State.SUCCESS, commit=False):
...
    # microseconds are supported by the database, but is not handled
    # correctly by airflow on e.g. the filesystem and in other places    
    # execution_date = execution_date.replace(microsecond=0) # I remove this code
...
{code}


> [Mark Success] not work in UI
> -----------------------------
>
>                 Key: AIRFLOW-1773
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-1773
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: api
>    Affects Versions: 1.8.2
>            Reporter: Winty
>            Assignee: Winty
>            Priority: Major
>              Labels: newbie
>         Attachments: 22.jpg, 33.jpg
>
>
> - When I click [Mark Success], there is no task instances 
> !33.jpg|thumbnail!
> so I try to find what is problem. and i can find somthing wrong.
> airflow / api / common / experimental / mark_tasks.py
> {code:python}
> def set_state(task, execution_date, upstream=False, downstream=False,
>               future=False, past=False, state=State.SUCCESS, commit=False):
> ...
>     if dag.schedule_interval == '@once':
>         dates = [start_date]
>     else:
>         dates = dag.date_range(start_date=start_date, end_date=end_date)
> ...
>     # verify the integrity of the dag runs in case a task was added or removed
>     # set the confirmed execution dates as they might be different
>     # from what was provided
>     confirmed_dates = []
>     drs = DagRun.find(dag_id=dag.dag_id, execution_date=dates)
>     for dr in drs:
>         dr.dag = dag
>         dr.verify_integrity()
>         confirmed_dates.append(dr.execution_date)
> {code}
> the drs is empty. because DagRun.find() with 'execution_date' is find same in DagRuns exactly. but, dag.date_range() make times upper second like 
> [...datetime.datetime(2017, 11, 1, 11, 30), datetime.datetime(2017, 11, 1, 12, 0), dateti
> me.datetime(2017, 11, 1, 12, 30), datetime.datetime(2017, 11, 1, 13, 0), datetime.datetime(2
> 017, 11, 1, 13, 30), datetime.datetime(2017, 11, 1, 14, 0)...]
> !22.jpg|thumbnail!
> so DagRun.find() can not find dags.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)