Skip to content
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-4038] Restructure database queries on /home #4872

Merged
merged 1 commit into from
Mar 10, 2019

Conversation

ffinfo
Copy link
Contributor

@ffinfo ffinfo commented Mar 7, 2019

Make sure you have checked all steps below.

Jira

Description

Restructure database queries in /home

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 (not including Jira issue reference)
    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.
    • All the public functions and the classes in the PR contain docstrings that explain what it does
    • If you implement backwards incompatible changes, please leave a note in the Updating.md so we can assign it to a appropriate release

Code Quality

  • Passes flake8

Copy link
Member

@XD-DENG XD-DENG left a comment

Choose a reason for hiding this comment

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

Seems the only main change here is to use create_session over decorator provide_session ? What's the main advantage of doing this? Or did I miss anything?

Thanks.

@codecov-io
Copy link

Codecov Report

Merging #4872 into master will decrease coverage by <.01%.
The diff coverage is 87.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4872      +/-   ##
==========================================
- Coverage   75.28%   75.28%   -0.01%     
==========================================
  Files         450      450              
  Lines       29026    29023       -3     
==========================================
- Hits        21853    21849       -4     
- Misses       7173     7174       +1
Impacted Files Coverage Δ
airflow/www/views.py 76.41% <87.5%> (-0.06%) ⬇️
airflow/models/__init__.py 92.81% <0%> (-0.06%) ⬇️

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 3dd7955...90b2b1b. Read the comment docs.

1 similar comment
@codecov-io
Copy link

Codecov Report

Merging #4872 into master will decrease coverage by <.01%.
The diff coverage is 87.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4872      +/-   ##
==========================================
- Coverage   75.28%   75.28%   -0.01%     
==========================================
  Files         450      450              
  Lines       29026    29023       -3     
==========================================
- Hits        21853    21849       -4     
- Misses       7173     7174       +1
Impacted Files Coverage Δ
airflow/www/views.py 76.41% <87.5%> (-0.06%) ⬇️
airflow/models/__init__.py 92.81% <0%> (-0.06%) ⬇️

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 3dd7955...90b2b1b. Read the comment docs.

@ffinfo
Copy link
Contributor Author

ffinfo commented Mar 7, 2019

@XD-DENG: Almost, indeed the main thing is to switch from provide_session to create_session. Also the order of statements is changes a bit because dags_query was build up on multiple statements but in-between the error query was there. this is now grouped.

About the switch from provide_session to create_session. Me and @Fokko did a little research and using create_session keeps less time a session locked to a scope. @provide_session on nested sessions can keep the session open for a long time while not really needed. Of course this is bigger then just this call but try to convert things where I can. Has targeting this method to remove the DagBag of the Webserver but I did notice that this call has no usage of DagBag. By this time I already changed the provide_session ;)

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.

I think the rewrite makes it easier to understand. Any further thoughts @XD-DENG ?

Copy link
Member

@XD-DENG XD-DENG left a comment

Choose a reason for hiding this comment

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

@Fokko LGTM

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.

Thanks @ffinfo

@Fokko Fokko merged this pull request into apache:master Mar 10, 2019
andriisoldatenko pushed a commit to andriisoldatenko/airflow that referenced this pull request Jul 26, 2019
wmorris75 pushed a commit to modmed/incubator-airflow that referenced this pull request Jul 29, 2019
@kaxil kaxil added this to the Airflow 1.10.11 milestone Apr 14, 2020
cfei18 pushed a commit to cfei18/incubator-airflow that referenced this pull request Mar 5, 2021
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.

5 participants