-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make LinkableElementSet.only_unique_path_keys consider distinct values
The only_unique_path_keys property in LinkableElementSet previously did a simple length check on the value tuple for each element type, meaning that a path key pointing to a tuple containing a lot of duplicate elements would not be included. This is almost certainly counter to expectation - indeed the only callsite for this property clearly expects consolidation to a unique value. The issue with this is some, but not all, of our LinkableElementSet operations do distinct value filtering. For example, the merge_by_path_key does not do such filtering, while the intersection_by_path_key does. Furthermore, there is nothing stopping a callsite from creating a set with duplicate elements, so this should probably apply the deduplication on each call regardless. This change adjusts the behavior to be more in line with end user expectations. If we decide that the intersect and merge methods should both be brought in line with allowing duplicates we can factor the deduplication logic out later.
- Loading branch information
Showing
2 changed files
with
38 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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