Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AIRFLOW-2951] Update dag_run table end_date when state change #3990

Merged

Conversation

YingboWang
Copy link
Contributor

The existing airflow only change dag_run table end_date value when
a user teminate a dag in web UI. The end_date will not be updated
if airflow detected a dag finished and updated its state.

This commit add end_date update in DagRun's set_state function to
make up tho problem mentioned above.

Make sure you have checked all steps below.

Jira

  • My PR addresses the following Airflow-2951 issues and references them in the PR title. For example, "[AIRFLOW-XXX] My Airflow PR"

Description

  • Here are some details about my PR, including screenshots of any UI changes:
    Same feature was merged in master before. This PR is to backport to v1-10-test

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:
    tests/models.py:DagRunTest.test_dagrun_set_state_end_date

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"

Documentation

  • In case of new functionality, my PR adds documentation that describes how to use it.
    • When adding new operators/hooks/sensors, the autoclass documentation generation needs to be added.

Code Quality

  • Passes git diff upstream/master -u -- "*.py" | flake8 --diff

@ashb @KevinYang21

The existing airflow only change dag_run table end_date value when
a user teminate a dag in web UI. The end_date will not be updated
if airflow detected a dag finished and updated its state.

This commit add end_date update in DagRun's set_state function to
make up tho problem mentioned above.
@codecov-io
Copy link

Codecov Report

Merging #3990 into v1-10-test will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@              Coverage Diff               @@
##           v1-10-test    #3990      +/-   ##
==============================================
+ Coverage       77.77%   77.78%   +<.01%     
==============================================
  Files             203      203              
  Lines           15306    15307       +1     
==============================================
+ Hits            11904    11906       +2     
+ Misses           3402     3401       -1
Impacted Files Coverage Δ
airflow/models.py 88.76% <100%> (+0.04%) ⬆️

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 0ee35e7...318f8f2. Read the comment docs.

@ashb ashb self-requested a review October 3, 2018 08:53
@ashb
Copy link
Member

ashb commented Oct 3, 2018

Thanks @YingboWang

@KevinYang21
Copy link
Member

👍 LGTM

@ashb ashb merged commit 965a41f into apache:v1-10-test Oct 3, 2018
ashb pushed a commit to ashb/airflow that referenced this pull request Oct 22, 2018
…e#3990)

The existing airflow only change dag_run table end_date value when
a user teminate a dag in web UI. The end_date will not be updated
if airflow detected a dag finished and updated its state.

This commit add end_date update in DagRun's set_state function to
make up tho problem mentioned above.
galak75 pushed a commit to VilledeMontreal/incubator-airflow that referenced this pull request Nov 23, 2018
…e#3990)

The existing airflow only change dag_run table end_date value when
a user teminate a dag in web UI. The end_date will not be updated
if airflow detected a dag finished and updated its state.

This commit add end_date update in DagRun's set_state function to
make up tho problem mentioned above.
cfei18 pushed a commit to cfei18/incubator-airflow that referenced this pull request Jan 23, 2019
The existing airflow only change dag_run table end_date value when
a user teminate a dag in web UI. The end_date will not be updated
if airflow detected a dag finished and updated its state.

This commit add end_date update in DagRun's set_state function to
make up tho problem mentioned above.
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Nov 22, 2019
…low#3990

GitOrigin-RevId: bf860a29a3d2bb25900fc36c6888f3a833830575
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Nov 22, 2019
…che/airflow#3990"

This reverts commit bf860a29a3d2bb25900fc36c6888f3a833830575.

Change-Id: I417cccf213cb62d6051a6fb7f74ed7ee91b56485
GitOrigin-RevId: f5532d76f2c791fb58521f6046150f48f4f3d909
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Apr 11, 2020
…low#3990

GitOrigin-RevId: bf860a29a3d2bb25900fc36c6888f3a833830575
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Apr 11, 2020
…che/airflow#3990"

This reverts commit bf860a29a3d2bb25900fc36c6888f3a833830575.

Change-Id: I417cccf213cb62d6051a6fb7f74ed7ee91b56485
GitOrigin-RevId: f5532d76f2c791fb58521f6046150f48f4f3d909
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Jun 16, 2021
…low#3990

GitOrigin-RevId: bf860a29a3d2bb25900fc36c6888f3a833830575
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Jun 16, 2021
…che/airflow#3990"

This reverts commit bf860a29a3d2bb25900fc36c6888f3a833830575.

Change-Id: I417cccf213cb62d6051a6fb7f74ed7ee91b56485
GitOrigin-RevId: f5532d76f2c791fb58521f6046150f48f4f3d909
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Jun 23, 2021
…low#3990

GitOrigin-RevId: bf860a29a3d2bb25900fc36c6888f3a833830575
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Jun 23, 2021
…che/airflow#3990"

This reverts commit bf860a29a3d2bb25900fc36c6888f3a833830575.

Change-Id: I417cccf213cb62d6051a6fb7f74ed7ee91b56485
GitOrigin-RevId: f5532d76f2c791fb58521f6046150f48f4f3d909
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.

4 participants