Skip to content

Conversation

@dima-asana
Copy link
Contributor

Make sure you have checked all steps below.

Jira

Description

  • Here are some details about my PR, including screenshots of any UI changes:
    If a DagRun does not have the same tasks as its DAG (e.g. a task is added or removed later), it should update its state based on its tasks rather than the DAG's.

This is probably mostly relevant when (a) adding a task to a DAG with a different start date and then (b) clearing a past DAG Run.

Note that this CR also removes the adhoc task references. The code path that led to this bug is attempting to exclude adhoc tasks, which don't exist anymore as of #1667. I've removed other references for consistency.

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:
    SchedulerJobTest.test_dagrun_root_after_dagrun_unfinished

Commits

  • My commits all reference Jira issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Code Quality

  • Passes flake8

@Fokko
Copy link
Contributor

Fokko commented Mar 4, 2019

Interesting. I never used the adhoc feature.

@Fokko
Copy link
Contributor

Fokko commented Mar 4, 2019

I've restarted the failing tests

dag.clear()
scheduler = SchedulerJob(dag_id, num_runs=2)
# we can't use dag.run or evaluate_dagrun because it uses BackfillJob
# instead of SchedulerJob and BackfillJobs are allowed to not respect start dates
Copy link
Member

@feng-tao feng-tao Mar 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you mean Unlike SchedulerJob, BackfillJobs are allowed to not respect start dates ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dima-asana , WDYT?

@feng-tao
Copy link
Member

one small nit, LGTM

Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restarted Travis

@codecov-io
Copy link

Codecov Report

Merging #4808 into master will increase coverage by 1.45%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4808      +/-   ##
==========================================
+ Coverage    75.3%   76.75%   +1.45%     
==========================================
  Files         450      456       +6     
  Lines       29023    34723    +5700     
==========================================
+ Hits        21855    26651    +4796     
- Misses       7168     8072     +904
Impacted Files Coverage Δ
airflow/jobs.py 79.78% <ø> (+2.92%) ⬆️
airflow/example_dags/tutorial.py 100% <ø> (ø) ⬆️
airflow/models/__init__.py 94.7% <100%> (+1.79%) ⬆️
airflow/contrib/hooks/winrm_hook.py 79.31% <0%> (-20.69%) ⬇️
airflow/__init__.py 81.25% <0%> (-14.75%) ⬇️
.../kubernetes_request_factory/pod_request_factory.py 86.56% <0%> (-13.44%) ⬇️
airflow/contrib/kubernetes/kube_client.py 62.06% <0%> (-12.94%) ⬇️
airflow/contrib/kubernetes/pod_launcher.py 78.28% <0%> (-11.88%) ⬇️
airflow/contrib/operators/mysql_to_gcs.py 80.2% <0%> (-9.87%) ⬇️
airflow/utils/decorators.py 84.48% <0%> (-7.19%) ⬇️
... and 91 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e220ac5...4e29315. Read the comment docs.

@feng-tao feng-tao merged commit bbcaf29 into apache:master Mar 24, 2019
@zhongjiajie
Copy link
Member

======================================================================
57) FAIL: test_dagrun_root_after_dagrun_unfinished (tests.test_jobs.SchedulerJobTest)
----------------------------------------------------------------------
   Traceback (most recent call last):
    tests/test_jobs.py line 2556 in test_dagrun_root_after_dagrun_unfinished
      self.assertEqual(first_run.state, State.SUCCESS)
   AssertionError: u'running' != u'success'
   - running
   + success

I find out our master branch ci failed due to this PR merge yesterday, And I have to go to bed because is mid-night in my zone. Maybe someone could take a look?

@Fokko @feng-tao

@feng-tao
Copy link
Member

will take a look

@tooptoop4
Copy link
Contributor

@dima-asana I believe this change caused AIRFLOW-4428 bug

andriisoldatenko pushed a commit to andriisoldatenko/airflow that referenced this pull request Jul 26, 2019
wmorris75 pushed a commit to modmed-external/incubator-airflow that referenced this pull request Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants