Repository navigation
Fix: Deduplicate list elements in 'append_to_list' with 'flatten' - #4014
Merged
Merged
Conversation
With 'flatten' set, 'append_to_list' checked whether the whole list was already an element of the target list, and then appended all list elements, including those already in the target list. This commit: * Appends only the list elements that are not already in the target list * Converts a scalar value of the target attribute into a one-element list before appending to it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change addresses scalar normalization and element-level deduplication in append_to_list, with documentation updated to reflect the revised behavior and no review issues identified.
No open issues 🎉
What changed in this PR
This pull request fixes append_to_list so flattened list additions are deduplicated element-by-element and scalar target attributes are normalized before appending.
Changes:
- Converts existing scalar target values into one-element lists.
- Appends only elements not already present when
flatten=True. - Updates the helper documentation to describe the revised behavior.
| File | Description |
|---|---|
netsim/data/__init__.py |
Updates append_to_list with scalar normalization and element-level deduplication. |
Review effort: Lite
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.
With 'flatten' set, 'append_to_list' checked whether the whole list was already an element of the target list, and then appended all list elements, including those already in the target list.
This commit: