mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-06-22 08:31:58 -04:00
b14415fa43
Added CollectionAggregateFunction base class that sets _is_collection_aggregate = True, and registered any_, all_, some_ as subclasses so that func.any(), func.all(), and func.some() correctly prevent operator flipping on negation. Previously ~(col == func.any(arr)) would incorrectly compile to col != any(arr) instead of NOT (col = any(arr)), which has different semantics for collection aggregate comparison modifiers. Also extended the _construct_for_op guard to check both left and right operands for _is_collection_aggregate, since func.any(arr) can appear on either side of a comparison unlike the standalone any_() construct which auto-reverses operands. Fixes: #13343 Change-Id: Id4774938876dc7f1f38cf143dccfe3c8ddba464d