Details
-
Type:
Bug
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: utils
-
Labels:None
-
Story Points:0.5
-
Team:Architecture
-
Urgent?:No
Description
The TemplateMeta metaclass in utils/wrappers.py replaces the __instancecheck__ and __subclasscheck__ methods so that it can look up the type being checked against its registry of templated classes. The registry check is written incorrectly, though, checking the type against the registry keys instead of the registry values. The result is that it falls through to an expensive loop checking isinstance for each type in the values.
The fix should be a simple addition of .values() to the if statement.
Attachments
Issue Links
- relates to
-
DM-32662 Optimize afw.table.Catalog.__getitem__
- In Progress
The simple fix works but now the code coverage is degraded because the fallback code is not triggered by any of the tests.