Closed
Conversation
cdgriffith
reviewed
May 30, 2025
Comment on lines
+842
to
+845
| frozen = self[k]._box_config['frozen_box'] | ||
| self[k]._box_config['frozen_box'] = False | ||
| self[k].merge_update(v, box_merge_lists=merge_type) | ||
| self[k]._box_config['frozen_box'] = frozen |
Owner
There was a problem hiding this comment.
Suggested change
| frozen = self[k]._box_config['frozen_box'] | |
| self[k]._box_config['frozen_box'] = False | |
| self[k].merge_update(v, box_merge_lists=merge_type) | |
| self[k]._box_config['frozen_box'] = frozen | |
| self[k]._box_config["frozen_box"] = self._box_config["frozen_box"] | |
| self[k].merge_update(v, box_merge_lists=merge_type) |
I think it might make more sense to just set it to the parent's setting, so it should always be as expected.
Author
There was a problem hiding this comment.
That makes sense, but I'm afraid it breaks frozen attribute for nested data. I've added 2 more test cases, ran this code against them, but one of them failed
Lines 999 to 1004 in 4f3a979
I think here is what happens:
- In
__add__methodfrozenis temporarily set toFalse(see code) - Later, when running
self[k]._box_config["frozen_box"] = self._box_config["frozen_box"]Thefrozen = Falseis assigned to the nested box, and it is never set toTrue.
Owner
|
Thanks for the ideas on this, going to go a slightly different route to force to make sure that the boxes can be modified the whole way down on adding in #302 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #291
I'm not entirely convinced this solution is valid. Maybe the merge_update function should accept a
frozen_mergekeyword argument. This argument would be set to True in the__add__method, allowing all the new code to be conditional within an if statement?