-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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-6428] Fix import path for airflow.utils.dates.days_ago in Example DAGs #7007
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7007 +/- ##
==========================================
- Coverage 84.85% 84.56% -0.29%
==========================================
Files 679 680 +1
Lines 38542 38543 +1
==========================================
- Hits 32703 32594 -109
- Misses 5839 5949 +110
Continue to review full report at Codecov.
|
Why don't we do it "differently" ... I am not sure why we are using those imports in this form? Do we have something that holds us back from changing all "days_ago" imports to the form that is much more pythonic (IMHO)? Adding anything to I think most of our I am happy to discuss it though, as we might have different understanding - and maybe we should expose all "exposable" classes from unit in this way as part of the "official airflow interface" (but I still think import should be Just to summary - we have two options:
and then using
Option 1 (with importing the whole 'airflow'). Option 2: (wiht importing only the function we need) WDYT @kaxil? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wanted to discuss general import approach in this case.
267995a
to
bafbe2f
Compare
I agree the 2nd option sounds lot better, I have changed the PR and updated all the example DAGs by importing just the function from module instead of init.py. |
👍 👍 👍 👍 👍 👍 👍 👍 👍 👍 👍 👍 👍 👍 👍 👍 👍 |
Needs rebase @kaxil :(. BTW. I think we need a "Needs rebase" probot. |
Hmm https://github.com/tibdex/autorebase - but it seems a bit abandoned in favour of autosquash. |
bafbe2f
to
aed85f6
Compare
Import the
days_ago
function directly fromairflow.utils.dates
in all our Example DAGs.Currently, without the entry in init.py, IDEs show that it could not find the reference to dates in most of our example_dags as they containairflow.utils.dates.days_ago(1)
and hence if you try to find the reference for days_ago function or dates modules it can't find it.In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.
Read the Pull Request Guidelines for more information.