You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see, the Jet/Jet section is simply updated (and thus overwritten) in the add operation. Imho, this is not the expected result - if two selections both produce the same collection (in this case Jet/Jet), the logical thing would be to select objects that survive both selections (i.e. do an AND between the indices).
Of course, we might also want to avoid this behavior altogether, since defining the same collection of objects in different selectors might cause confusion. On the other hand, this would limit the usage of the selectors - maybe a user wants to update a given collection of objects based on some other criteria.
Imho, there are two way we could go about this:
Supress the definition of the same field in different SelectionResults, i.e. raise some kind of Error
update the add operation to do a proper AND of the indices.
What do you think about this?
The text was updated successfully, but these errors were encountered:
Unexpected behavior is definitely the worst enemy of potential framework users.
I think there is no automatic way to decide which of the indices to use, and also the AND of two sets of indices is undefined, i.e., while there might be an easy way to select only the intersection of two sets of indices, the order is important and we cannot infer a merged order. I think we should raise in these cases.
Thanks for the feedback @riga ! I'll implement something and add a unit test for this case as well 👍 We should also add this to the docs accordingly as soon as it's merged.
While writing unit tests for the
SelectionResult
class, I came upon this feature of the current implementation. Consider these two object fields:After adding two SelectionResult instances derived from the dictionaries above (called
bar
), I see thisAs you can see, the
Jet/Jet
section is simply updated (and thus overwritten) in theadd
operation. Imho, this is not the expected result - if two selections both produce the same collection (in this caseJet/Jet
), the logical thing would be to select objects that survive both selections (i.e. do an AND between the indices).Of course, we might also want to avoid this behavior altogether, since defining the same collection of objects in different selectors might cause confusion. On the other hand, this would limit the usage of the selectors - maybe a user wants to update a given collection of objects based on some other criteria.
Imho, there are two way we could go about this:
What do you think about this?
The text was updated successfully, but these errors were encountered: