Skip to content

Conversation

@milton0825
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:
    Introduce two new macros:
    {{ prev_ds }}: the previous execution date as {{ YYYY-MM-DD }}
    {{ next_ds }}: the next execution date as {{ YYYY-MM-DD }}

Tests

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

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
    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

Copy link
Member

@feng-tao feng-tao May 24, 2018

Choose a reason for hiding this comment

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

per discussion, I wonder if we could have a better default value here .

But good to see the travis CI pass :)

Copy link
Contributor Author

@milton0825 milton0825 May 24, 2018

Choose a reason for hiding this comment

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

The idea of {{ next_ds }} is just {{ next_execution_date }} in YYYY-MM-DD format so that we don't need to write something like {{ ds_format(next_execution_date, "%Y-%m-%d")}}

Thus I think we should make sure that the behavior of {{ next_ds }} aligns with
{{ next_execution_date }}.

So I think we should do either:
option 1:
If {{ next_execution_date }} is None, we set {{ next_ds }} to None.

option 2:
We make sure {{ next_execution_date }} is never None. But this will change the fact that
{{ next_execution_date }} is None when schedule_interval="@once".

Copy link
Member

Choose a reason for hiding this comment

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

cool, Default with none is ok in this case.

@milton0825
Copy link
Contributor Author

@feng-tao
Copy link
Member

lgtm

@milton0825
Copy link
Contributor Author

milton0825 commented May 25, 2018

@Fokko @kaxil @mistercrunch

@codecov-io
Copy link

Codecov Report

Merging #3418 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3418      +/-   ##
==========================================
+ Coverage    76.5%   76.51%   +<.01%     
==========================================
  Files         203      203              
  Lines       15025    15031       +6     
==========================================
+ Hits        11495    11501       +6     
  Misses       3530     3530
Impacted Files Coverage Δ
airflow/models.py 87.08% <100%> (+0.03%) ⬆️

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 e4e7b55...20398f4. Read the comment docs.

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.

LGTM

@asfgit asfgit closed this in 66f00bb May 25, 2018
@milton0825 milton0825 deleted the introduce-next_ds-prev_ds branch May 25, 2018 17:02
sekikn pushed a commit to sekikn/airflow that referenced this pull request May 28, 2018
Closes apache#3418 from milton0825/introduce-next_ds-
prev_ds
aliceabe pushed a commit to aliceabe/incubator-airflow that referenced this pull request Jan 3, 2019
Closes apache#3418 from milton0825/introduce-next_ds-
prev_ds
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