fix(checker): correct return type for column aggregation
Tests / tests (pull_request) Successful in 10s

This commit is contained in:
HEL
2026-07-24 00:03:26 +02:00
parent 3ab0dda682
commit e37432ad57
3 changed files with 17 additions and 46 deletions
@@ -13,7 +13,6 @@ from midas.checker.types import (
Function, Function,
ParamSpec, ParamSpec,
Type, Type,
UnknownType,
) )
if TYPE_CHECKING: if TYPE_CHECKING:
@@ -97,11 +96,9 @@ class ColumnGroupByMethodRegistry(MethodRegistry[Call]):
positional=[], positional=[],
keywords={}, keywords={},
) )
if not isinstance(returns, ColumnType):
returns = ColumnType(type=UnknownType())
signature = Function( signature = Function(
params=ParamSpec(mixed=real_params), params=ParamSpec(mixed=real_params),
returns=returns, returns=ColumnType(type=returns),
) )
result: CallResult = self.dispatcher.get_result( result: CallResult = self.dispatcher.get_result(
+2 -4
View File
@@ -364,14 +364,12 @@ class ColumnMethodRegistry(MethodRegistry[Call]):
Type: the result type Type: the result type
""" """
returns: Type = ColumnType(type=TopType()) returns: Type = TopType()
if formula: if formula:
returns = ColumnType( returns = self._resolve_formula_type(
type=self._resolve_formula_type(
call, call,
formula(call.column.type), formula(call.column.type),
) )
)
signature = Function( signature = Function(
params=ParamSpec( params=ParamSpec(
kw=[ kw=[
@@ -4305,9 +4305,7 @@
"arguments": [], "arguments": [],
"keywords": {} "keywords": {}
}, },
"type": {
"type": {} "type": {}
}
}, },
{ {
"location": { "location": {
@@ -4342,9 +4340,7 @@
"arguments": [], "arguments": [],
"keywords": {} "keywords": {}
}, },
"type": {
"type": {} "type": {}
}
}, },
{ {
"location": { "location": {
@@ -4379,11 +4375,9 @@
"arguments": [], "arguments": [],
"keywords": {} "keywords": {}
}, },
"type": {
"type": { "type": {
"name": "int" "name": "int"
} }
}
}, },
{ {
"location": { "location": {
@@ -4418,11 +4412,9 @@
"arguments": [], "arguments": [],
"keywords": {} "keywords": {}
}, },
"type": {
"type": { "type": {
"name": "float" "name": "float"
} }
}
}, },
{ {
"location": { "location": {
@@ -4457,11 +4449,9 @@
"arguments": [], "arguments": [],
"keywords": {} "keywords": {}
}, },
"type": {
"type": { "type": {
"name": "int" "name": "int"
} }
}
}, },
{ {
"location": { "location": {
@@ -4496,11 +4486,9 @@
"arguments": [], "arguments": [],
"keywords": {} "keywords": {}
}, },
"type": {
"type": { "type": {
"name": "int" "name": "int"
} }
}
}, },
{ {
"location": { "location": {
@@ -4535,11 +4523,9 @@
"arguments": [], "arguments": [],
"keywords": {} "keywords": {}
}, },
"type": {
"type": { "type": {
"name": "int" "name": "int"
} }
}
}, },
{ {
"location": { "location": {
@@ -4574,11 +4560,9 @@
"arguments": [], "arguments": [],
"keywords": {} "keywords": {}
}, },
"type": {
"type": { "type": {
"name": "int" "name": "int"
} }
}
}, },
{ {
"location": { "location": {
@@ -4613,11 +4597,9 @@
"arguments": [], "arguments": [],
"keywords": {} "keywords": {}
}, },
"type": {
"type": { "type": {
"name": "int" "name": "int"
} }
}
}, },
{ {
"location": { "location": {
@@ -4652,9 +4634,7 @@
"arguments": [], "arguments": [],
"keywords": {} "keywords": {}
}, },
"type": {
"type": {} "type": {}
}
}, },
{ {
"location": { "location": {
@@ -4689,11 +4669,9 @@
"arguments": [], "arguments": [],
"keywords": {} "keywords": {}
}, },
"type": {
"type": { "type": {
"name": "int" "name": "int"
} }
}
}, },
{ {
"location": { "location": {
@@ -4728,9 +4706,7 @@
"arguments": [], "arguments": [],
"keywords": {} "keywords": {}
}, },
"type": {
"type": {} "type": {}
}
}, },
{ {
"location": { "location": {