[AIRFLOW-6416] Sort default connection by conn_id#6987
Conversation
|
Oh, we already add more probot to repo, Mergeable is good! |
56ac11e to
21cb5dc
Compare
Codecov Report
@@ Coverage Diff @@
## master #6987 +/- ##
=========================================
- Coverage 84.99% 84.7% -0.29%
=========================================
Files 679 679
Lines 38647 38647
=========================================
- Hits 32847 32737 -110
- Misses 5800 5910 +110
Continue to review full report at Codecov.
|
|
@zhongjiajie why do you want to remove @provide_session ? The way it works now, it will create a new session for each connection - each merge_conn will have a new session (which basically means new connection established with the database). With @provide_sesion, the session will be reused whereas with the new approach it will be create/commit/close for every single Connection entry. |
potiuk
left a comment
There was a problem hiding this comment.
We should not remove @provide_session as it is there to make all the connections reuse session rather than recreate sessions.
|
And we could not remove @provide_session in function |
I think we don't need to create connect in function
I get that point |
The @provide_session decorator (and merge_conn uses it) follow exactly the pattern of session/transaction passing. It's there to handle the case that a session is created once, transaction starts, and you reuse the session do everything in the same DB transaction. So it is really needed :) |
21cb5dc to
4154a3e
Compare
|
Do we need this? The connections in the Airflow UI are already sorted. |
|
I think it maybe more easy to maintain the code, what do you think? @kaxil |
|
No strong opinion - but I think it only makes sense if we enforce it afterwards (like we did with a number of other pre-commit checks). It's low priority I think. |
* Sort create_default_connections by connection id * Add sort connection id unittest
4154a3e to
ccaa6d8
Compare
potiuk
left a comment
There was a problem hiding this comment.
I like that you added test for it :)
|
Thanks Jarek and Kaxil for review |
[AIRFLOW-6416]for document-only changesIn 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.