[Airflow-1606] airflow.models.DAG.sync_to_db is no longer a static method#2605
[Airflow-1606] airflow.models.DAG.sync_to_db is no longer a static method#2605ashb wants to merge 1 commit intoapache:masterfrom
Conversation
|
LGTM. Please rebase, squash and use imperative for commit message. After successful ci I'll merge. |
9ecf249 to
c33cc23
Compare
Previously it was a static method that took as it's first argument a DAG, which really meant it wasn't truly a static method. To avoid reversing the parameter order I have given sensible defaults from the one and only use in the rest of the code base. Also remove documented "sync_to_db" parameter on DagBag that no longer exists -- this doc string refers to a parameter that was removed in [AIRFLOW-160].
c33cc23 to
16b1eca
Compare
|
Squashed. Happy with the commit message? |
Codecov Report
@@ Coverage Diff @@
## master #2605 +/- ##
==========================================
+ Coverage 70.71% 70.71% +<.01%
==========================================
Files 150 150
Lines 11564 11565 +1
==========================================
+ Hits 8177 8178 +1
Misses 3387 3387
Continue to review full report at Codecov.
|
|
I think you've missed one call: |
|
Argh, well spotted! Edit, updated that one now. |
|
Happy with the message. If you fix that last call ;-) then I'll merge. |
|
Done. |
|
BTW: as tests did not catch that missed refactor should we make it so (i.e. fail if it uses the old call)? |
|
It turns out that (at least in Py3) this change is backwards compatible: And the output is: So since the arg order was the same this missed one wasn't an actual problem. Which also means I'm not sure how we might test for it. |
|
K, just assuming you refactored properly then :P |
|
Oef, commit message wasn't entirely clean. We will survive. |
|
That was merged too soon, I think the amend of @ashb is missing: |
|
Mmm yes it seems so. Anyone for a hot fix? |
|
D'oh yes, missed the force push after final rebase :( A new PR against the same Jira ticket? |
|
Ah someone is on it already 👍 |
Dear Airflow maintainers,
Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!
JIRA
Description
This will need #2602 merged first (to make
dag.loggeravailable again)Tests
Commits
Dear Airflow maintainers,
Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!
JIRA
Description
airflow.models.DAG.sync_to_db is declared as a static method, but it takes as it's first argument a DAG object (i.e. the same class that the method is delcared on). This is a bit odd
This will need #2602 (AIRFLOW-1605) merged first (to make
dag.loggeravailable again)Tests
Commits