[AIRFLOW-1729] DagBag Improve time taken in collect_dags#3170
Closed
q2w wants to merge 5 commits intoapache:masterfrom
q2w:master
Closed
[AIRFLOW-1729] DagBag Improve time taken in collect_dags#3170q2w wants to merge 5 commits intoapache:masterfrom q2w:master
q2w wants to merge 5 commits intoapache:masterfrom
q2w:master
Conversation
artwr
requested changes
Mar 28, 2018
airflow/models.py
Outdated
| f = open(os.path.join(root, ignore_file[0]), 'r') | ||
| patterns = [] | ||
| ignore_file = os.path.join(root, '.airflowignore') | ||
| if os.path.exists(ignore_file): |
Contributor
There was a problem hiding this comment.
Can I recommend os.path.isfile instead? exists could return true for a directory.
airflow/models.py
Outdated
| patterns = [] | ||
| ignore_file = os.path.join(root, '.airflowignore') | ||
| if os.path.exists(ignore_file): | ||
| f = open(ignore_file, 'r') |
Contributor
There was a problem hiding this comment.
maybe we could use a with context manager here, it will take care of closing the file in case of an exception.
added 3 commits
March 28, 2018 22:29
…xists and open .airflowignore file by with context manager
…xists and open .airflowignore file by with context manager
…xists and open .airflowignore file by with context manager
q2w
commented
Mar 28, 2018
airflow/models.py
Outdated
| f = open(os.path.join(root, ignore_file[0]), 'r') | ||
| patterns = [] | ||
| ignore_file = os.path.join(root, '.airflowignore') | ||
| if os.path.exists(ignore_file): |
airflow/models.py
Outdated
| patterns = [] | ||
| ignore_file = os.path.join(root, '.airflowignore') | ||
| if os.path.exists(ignore_file): | ||
| f = open(ignore_file, 'r') |
Codecov Report
@@ Coverage Diff @@
## master #3170 +/- ##
==========================================
+ Coverage 73.77% 73.86% +0.08%
==========================================
Files 191 191
Lines 14349 14348 -1
==========================================
+ Hits 10586 10598 +12
+ Misses 3763 3750 -13
Continue to review full report at Codecov.
|
Contributor
|
@q2w, LGTM. One last request, can you rebase and squash your commits add [AIRFLOW-1729] to your commit message? |
Author
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make sure you have checked all steps below.
JIRA
Description
The change will remove unnecessary accumulation of .airflowignore file entries.
Tests
Trivial change
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":
Passes
git diff upstream/master -u -- "*.py" | flake8 --diff