We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 09a7e98 + 49617fd commit 82de2b3Copy full SHA for 82de2b3
dj/sql/functions.py
@@ -495,7 +495,7 @@ def infer_type( # noqa: F811 # pylint: disable=function-redefined
495
then: ct.ColumnType,
496
else_: ct.ColumnType,
497
) -> ct.ColumnType:
498
- if then.type != else_.type:
+ if not then.type.is_compatible(else_.type):
499
raise DJInvalidInputException(
500
message="The then result and else result must match in type! "
501
f"Got {then.type} and {else_.type}",
0 commit comments