Skip to content

[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#3170
q2w wants to merge 5 commits intoapache:masterfrom
q2w:master

Conversation

@q2w
Copy link

@q2w q2w commented Mar 28, 2018

Make sure you have checked all steps below.

JIRA

Description

  • Here are some details about my PR, including screenshots of any UI changes:
    The change will remove unnecessary accumulation of .airflowignore file entries.

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:
    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":

    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"
  • Passes git diff upstream/master -u -- "*.py" | flake8 --diff

Copy link
Contributor

@artwr artwr left a comment

Choose a reason for hiding this comment

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

Some minor changes.

f = open(os.path.join(root, ignore_file[0]), 'r')
patterns = []
ignore_file = os.path.join(root, '.airflowignore')
if os.path.exists(ignore_file):
Copy link
Contributor

Choose a reason for hiding this comment

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

Can I recommend os.path.isfile instead? exists could return true for a directory.

Copy link
Author

Choose a reason for hiding this comment

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

it seems good.. thanks

patterns = []
ignore_file = os.path.join(root, '.airflowignore')
if os.path.exists(ignore_file):
f = open(ignore_file, 'r')
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we could use a with context manager here, it will take care of closing the file in case of an exception.

Copy link
Author

Choose a reason for hiding this comment

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

thanks...

Abhishek Tiwari 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
Copy link
Author

@q2w q2w left a comment

Choose a reason for hiding this comment

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

suggested changes done. Thanks.

f = open(os.path.join(root, ignore_file[0]), 'r')
patterns = []
ignore_file = os.path.join(root, '.airflowignore')
if os.path.exists(ignore_file):
Copy link
Author

Choose a reason for hiding this comment

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

it seems good.. thanks

patterns = []
ignore_file = os.path.join(root, '.airflowignore')
if os.path.exists(ignore_file):
f = open(ignore_file, 'r')
Copy link
Author

Choose a reason for hiding this comment

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

thanks...

@codecov-io
Copy link

codecov-io commented Mar 28, 2018

Codecov Report

Merging #3170 into master will increase coverage by 0.08%.
The diff coverage is 60%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
airflow/models.py 87.27% <60%> (+0.08%) ⬆️
airflow/jobs.py 80.08% <0%> (+0.44%) ⬆️
airflow/utils/helpers.py 54.02% <0%> (+2.87%) ⬆️
airflow/task/task_runner/bash_task_runner.py 100% <0%> (+6.66%) ⬆️

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 e21a2d2...555d62d. Read the comment docs.

@artwr
Copy link
Contributor

artwr commented Mar 28, 2018

@q2w, LGTM. One last request, can you rebase and squash your commits add [AIRFLOW-1729] to your commit message?

@q2w
Copy link
Author

q2w commented Mar 28, 2018

@artwr i have created an alternative clean pull request..
#3171

@Fokko
Copy link
Contributor

Fokko commented Mar 28, 2018

Thanks @q2w. Could you close this PR? I've merged #3171

@q2w q2w closed this Mar 29, 2018
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