-
Notifications
You must be signed in to change notification settings - Fork 200
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
ORM: deprecate double underscores in LinkManager
contains
#5067
ORM: deprecate double underscores in LinkManager
contains
#5067
Conversation
8766f33
to
6c34e1a
Compare
Codecov Report
@@ Coverage Diff @@
## develop #5067 +/- ##
===========================================
+ Coverage 80.38% 80.39% +0.02%
===========================================
Files 529 529
Lines 36867 36881 +14
===========================================
+ Hits 29632 29647 +15
+ Misses 7235 7234 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Just a small comment: the breaking change was released with v1.6.2 (see "Commits on Apr 26, 2021") so perhaps it would be nice if we could add this to the v1.6.5 release branch you were preparing. Maybe this was your original idea, but since you only mention 2.0 in the OP I just wanted to mention this explicitly. |
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.
Great fix! With all paths being tested and all! Only have one comment regarding the clarity of the warning message, but it LGTM.
The use of double underscores in the interface of the `LinkManager` was recently deprecated for v2.0, however, it unintentionally broke the `__contains__` operator. Legacy code that was using code like: if 'some__nested__namespace' in node.inputs which used to work, will now return false, breaking existing code. The solution is to override the `__contains__` operator and check for the presence of a double underscore in the key. If that is the case, now a deprecation warning is emitted, but the key is split on the double underscores and the namespaces are used to fetch the intended nested dictionary before applying the actual contains check on the leaf node.
6c34e1a
to
4dd16e9
Compare
Yes, this should also go in the backport release. Once merged, I will cherry-pick it. |
The use of double underscores in the interface of the `LinkManager` was recently deprecated for v2.0, however, it unintentionally broke the `__contains__` operator. Legacy code that was using code like: if 'some__nested__namespace' in node.inputs which used to work, will now return false, breaking existing code. The solution is to override the `__contains__` operator and check for the presence of a double underscore in the key. If that is the case, now a deprecation warning is emitted, but the key is split on the double underscores and the namespaces are used to fetch the intended nested dictionary before applying the actual contains check on the leaf node. Cherry-pick: bf80fde
Fixes #4953
The use of double underscores in the interface of the
LinkManager
wasrecently deprecated for v2.0, however, it unintentionally broke the
__contains__
operator. Legacy code that was using code like:which used to work, will now return false, breaking existing code. The
solution is to override the
__contains__
operator and check for thepresence of a double underscore in the key. If that is the case, now a
deprecation warning is emitted, but the key is split on the double
underscores and the namespaces are used to fetch the intended nested
dictionary before applying the actual contains check on the leaf node.