-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
param: fix exponential memory allocation #10178
Conversation
for more information, see https://pre-commit.ci
@0x2b3bfa0, is there a way without using deepcopy? |
We don't support |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10178 +/- ##
==========================================
+ Coverage 90.61% 90.63% +0.01%
==========================================
Files 499 499
Lines 37880 37881 +1
Branches 5505 5505
==========================================
+ Hits 34326 34332 +6
+ Misses 2912 2909 -3
+ Partials 642 640 -2 ☔ View full report in Codecov by Sentry. |
We can try I was about to suggest another alternative based on PyYAML serialization/deserialization, but it seems like anchors can't be disabled: yaml/pyyaml#103. |
Does making from funcy import ldistinct
key_paths = ldistinct(key_paths) |
Looks like not. As all different keypaths point to same reference. |
Yes, it seems so! I need to get some sleep, but you may find the minimal examples at #10177 useful for debugging. |
Although this would fix the issue for the particular snippet, dvc is still susceptible to "billion laughs" attack. See yaml/pyyaml#235 and kislyuk/yq#134. |
Closes #10177.
Explanation
dpath.merge
appends new elements to existing lists.config
will also be applied to e.g. lists insideret
sharing the same anchor.Before
After