-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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-3735] Separate dag parsing from checking #4880
Conversation
If the PR is not yet ready for review on Airflow community can you hold off on opening a PR - our Travis builds are paid for by the ASF and we don't want to use more than we have to :) (I do much of my testing on my own fork with travis set up there for instance. See CONTRIBUTING.md) |
@ashb It is ready but once again I got this Any idea maybe? About the travis thing. I can understand this but doing this on a fork still means load for travis. This issue particular because I can't reproduce it local. I try only to open a PR once I think it's done but travis seems to be very good to give unexpected errors. |
…est setting like postgress/mysql/sqlite
Codecov Report
@@ Coverage Diff @@
## master #4880 +/- ##
==========================================
+ Coverage 76.23% 76.26% +0.02%
==========================================
Files 466 466
Lines 30101 30107 +6
==========================================
+ Hits 22949 22960 +11
+ Misses 7152 7147 -5
Continue to review full report at Codecov.
|
@@ -0,0 +1,583 @@ | |||
# -*- coding: utf-8 -*- |
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.
This is just moving code from (test_)models.py
# Conflicts: # tests/cli/test_cli.py # tests/test_models.py
# Conflicts: # tests/models/__init__.py
@@ -1739,7 +1669,7 @@ def email_alert(self, exception): | |||
jinja_context.update(dict( | |||
exception=exception, | |||
exception_html=exception_html, | |||
try_number=self.try_number - 1, | |||
try_number=self.try_number, |
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.
Why did we change this?
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.
This was because the test order did change because I moved the DagBag tests to a separated file. In the testing the state of a task would be changed from RUNNING
to something else. the try_number
in TaskInstances
does a +1 based on the state. Not the cleanest way. @ashb, I see this part is on your name. Can you double check the logic here?
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.
About all I remember of this code now was it was a hack on top of a hack :(
@@ -1309,3 +1315,81 @@ def end(self): | |||
self.log.info("Killing child PID: %s", child.pid) | |||
child.kill() | |||
child.wait() | |||
|
|||
|
|||
def process_dag_file(filepath, safe_mode=True): |
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.
Personally, I'm not a fan of separate functions, can't we merge this into a class as a static method? For example the DagFileProcessorAgent
.
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.
For functionality this does not matter. Adding a class that will never be initialised feels wrong for me. If this is part of a class this would make sense but this is an independent method that can be used in multiple location and not bound to a single class.
Still if this is a blocking issue I can move to an existing class or make a new class for this.
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.
Some small issues. As far as I see it, it is just moving a lot of stuff out of models to separate files. In this case, it is out of the infamous models.py
👍
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Make sure you have checked all steps below.
Jira
Description
Extracting parsing to a separated method
Tests
Commits
Documentation
Code Quality
flake8