-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ORM: deprecate double underscores in
LinkManager
contains (#5067)
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.
- Loading branch information
Showing
2 changed files
with
58 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters