-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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-6392] Remove cyclic dependency baseoperator <-> helpers #6950
[AIRFLOW-6392] Remove cyclic dependency baseoperator <-> helpers #6950
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6950 +/- ##
==========================================
- Coverage 84.81% 84.53% -0.29%
==========================================
Files 679 679
Lines 38495 38618 +123
==========================================
- Hits 32649 32645 -4
- Misses 5846 5973 +127
Continue to review full report at Codecov.
|
I'd love some other review as well for that one, I am moving some of the "helper" methods to BaseOperator's static methods so it would be great to see if others have an opinion on that one :). |
And we have a follow-up substantial pylint update on top of that, so it would be great to merge it rather quickly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These functions are used by users, so we should think about backward compatibility.
CC: @zhongjiajie |
Related PR: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These functions are used by users, so we should think about backward compatibility.
Yep. Agree - that's why i called others :) |
3456068
to
c33cdaf
Compare
@mik-laj -> moved the methods back to be module methods (in baseoperator module) also added more description in UPDATING. I would love to hear what others think about the need of keeping the backwards compatibility here. Seems that we can't agree with @mik-laj whether it's important or not in this case. |
f531c8c
to
2e803af
Compare
@@ -670,6 +672,7 @@ def __deepcopy__(self, memo): | |||
|
|||
for k, v in self.__dict__.items(): | |||
if k not in shallow_copy: | |||
# noinspection PyArgumentList |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this? I don't think we need this check. We can disable this check on our Pycharm/Intelij
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am afraid so. The check is super useful because it detects spelling mistakes in parameters or removed parameters.
This is actually a known problem because the memo parameter is by mistake missing in skeleton definition for python skeletons (from typeshed I believe). The issue is described
here: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000181224-deepcopy-unexpected-memo-argument
and reported here (unresolved): https://youtrack.jetbrains.com/issue/PY-29664
I have not found a good way of silencing it only for deepcopy, so I propose we can leave it as it is.
2e803af
to
97a91b8
Compare
Updated all comments @kaxil ! What shall we do with the backwards compatibility there? Do you think we should worry about this in this case? |
#6950 (comment) - I think this one is still pending. I think this is the chance to make it right so I won't worry much about backward-compatibility here. We won't merge this into 1.10.* |
97a91b8
to
5594ddf
Compare
@mik-laj ? |
@potiuk can you rebase? |
I submit #4779 due to use bit shift will so lengthy in some situation as I comment in #4779 (comment), but when I use |
Our community have another function |
@potiuk Should we add remind user different import path in https://github.com/apache/airflow/blob/master/docs/concepts.rst#relationship-helper for different Airflow version? Besides, code looking good for me |
IMO, If only import path change but function still exists, I think is not a problem. But if remove function should be more careful. |
There is a hidden cyclic dependency between baseoperator and helpers module. It's hidden by local import but it is detected when baseoperator/helpers are removed from pylint_todo.txt (and it's really there). The dependency comes from BaseOperator using helpers and two helpers methods (chain and cross_downstream) using BaseOperator. This can be solved by converting the chain and cross_downstream methods to be static methods in BaseOperator class.
5594ddf
to
2d5c38f
Compare
@zhongjiajie -> I added a note in concepts (and changed the name to "Relationship builders" :). |
…che#6950) There is a hidden cyclic dependency between baseoperator and helpers module. It's hidden by local import but it is detected when baseoperator/helpers are removed from pylint_todo.txt (and it's really there). The dependency comes from BaseOperator using helpers and two helpers methods (chain and cross_downstream) using BaseOperator. This can be solved by converting the chain and cross_downstream methods to be static methods in BaseOperator class.
There is a hidden cyclic dependency between baseoperator and helpers module.
It's hidden by local import but it is detected when baseoperator/helpers are
removed from pylint_todo.txt (and it's really there).
The dependency comes from BaseOperator using helpers and two helpers methods
(chain and cross_downstream) using BaseOperator. This can be solved by
converting the chain and cross_downstream methods to be static methods in
BaseOperator class.
[AIRFLOW-XXXX]
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.