Changes between Version 2 and Version 3 of Ticket #36051, comment 3
- Timestamp:
- Jan 4, 2025, 8:24:35 PM (4 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #36051, comment 3
v2 v3 5 5 To me #36042 and and this ticket should be addressed by introducing a `BaseExpression.allows_composite_expressions: bool = False` that we set to `True` on `Count` and `TupleLookupMixin` and make `BaseExpression.resolve_expression` raise a `ValueError` when it's set to `False` and any of its source expression is an instance of `ColPairs`. 6 6 7 Don't get me wrong I think we should define `arity` for `Aggregate` subclasses to guard against improper calls but I don't think that making `Func.resolve_expression` unpack composite expressions is something we should do for the aforementioned reasons. In essence this is the same problem as `model_instance.pk` now returning a `tuple` and requiring some special care but at the field resolving level.7 Don't get me wrong I think we should define `arity` for `Aggregate` subclasses to guard against improper calls but I don't think that making `Func.resolve_expression` unpack composite expressions to trigger arity check failures is something we should do for the aforementioned reasons. In essence this is the same problem as `model_instance.pk` now returning a `tuple` and requiring some special care but at the field resolving level.