-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
copy translate_list_to_dict default argument #1382
base: master
Are you sure you want to change the base?
Conversation
b0d9e62
to
e3c70df
Compare
e3c70df
to
ecd50e3
Compare
ormar/queryset/utils.py
Outdated
@@ -64,7 +64,7 @@ def translate_list_to_dict( # noqa: CCR001 | |||
for path in list_to_trans: | |||
current_level = new_dict | |||
parts = path.split("__") | |||
def_val: Any = default | |||
def_val: Any = copy.copy(default) |
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 would go with deepcopy as it can be nested dict, list of dicts or some mutable custom object
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.
Makes sense. Updated and added test
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1382 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 206 206
Lines 14940 14944 +4
=========================================
+ Hits 14940 14944 +4
|
CodSpeed Performance ReportMerging #1382 will degrade performances by 23.83%Comparing Summary
Benchmarks breakdown
|
Fixes #1381