-
Notifications
You must be signed in to change notification settings - Fork 74
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
crud update fix #481
crud update fix #481
Conversation
@@ -206,7 +206,7 @@ def _create_update_entity_filter(self, entity): | |||
raise YPYServiceError(error_msg=err_msg) | |||
|
|||
module = importlib.import_module(entity._meta_info().pmodule_name) | |||
update_filter = getattr(module, entity._meta_info().name)() | |||
update_filter = operator.attrgetter(entity._meta_info().name)(module)() |
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.
Thanks for your contribution. Need to import the operator
module. This is causing the CI to fail.
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.
Added the change in the same commit. Thanks.
Codecov Report
@@ Coverage Diff @@
## master #481 +/- ##
==========================================
- Coverage 84.01% 83.99% -0.03%
==========================================
Files 109 109
Lines 13050 13051 +1
Branches 1885 1885
==========================================
- Hits 10964 10962 -2
- Misses 1566 1572 +6
+ Partials 520 517 -3
Continue to review full report at Codecov.
|
Thanks for your contribution! |
The update operation in crud_service.py has a _create_update_entity_filter function, which tries to read the entity in the module, but the update_filter fails to fetch the nested class instance, because of the behavior of python getattr function, which does not support consecutive attribute retrievals.
The fix for this issue can be to use the operator.attrgetattr() python function instead.