feat(checker): add comparison binary ops on columns

This commit is contained in:
2026-07-03 01:05:24 +02:00
parent 66b585c3d6
commit 1f6189daa4
2 changed files with 61 additions and 182 deletions

View File

@@ -136,6 +136,30 @@ class ColumnMethodRegistry(MethodRegistry[Call]):
def pow(self, call: Call) -> Type:
return self._element_wise(call, "__pow__")
@method("lt", "__lt__")
def lt(self, call: Call) -> Type:
return self._element_wise(call, "__lt__")
@method("gt", "__gt__")
def gt(self, call: Call) -> Type:
return self._element_wise(call, "__gt__")
@method("le", "__le__")
def le(self, call: Call) -> Type:
return self._element_wise(call, "__le__")
@method("ge", "__ge__")
def ge(self, call: Call) -> Type:
return self._element_wise(call, "__ge__")
@method("ne", "__ne__")
def ne(self, call: Call) -> Type:
return self._element_wise(call, "__ne__")
@method("eq", "__eq__")
def eq(self, call: Call) -> Type:
return self._element_wise(call, "__eq__")
@method()
def mean(self, call: Call) -> Type:
signature = Function(

View File

@@ -1,174 +1,5 @@
{
"diagnostics": [
{
"type": "Warning",
"location": {
"start": [
16,
4
],
"end": [
16,
13
]
},
"message": "Unknown method __lt__ on Column[int]"
},
{
"type": "Warning",
"location": {
"start": [
16,
4
],
"end": [
16,
13
]
},
"message": "Unknown method __lt__ on Column[float]"
},
{
"type": "Warning",
"location": {
"start": [
17,
4
],
"end": [
17,
13
]
},
"message": "Unknown method __gt__ on Column[int]"
},
{
"type": "Warning",
"location": {
"start": [
17,
4
],
"end": [
17,
13
]
},
"message": "Unknown method __gt__ on Column[float]"
},
{
"type": "Warning",
"location": {
"start": [
18,
4
],
"end": [
18,
14
]
},
"message": "Unknown method __le__ on Column[int]"
},
{
"type": "Warning",
"location": {
"start": [
18,
4
],
"end": [
18,
14
]
},
"message": "Unknown method __le__ on Column[float]"
},
{
"type": "Warning",
"location": {
"start": [
19,
4
],
"end": [
19,
14
]
},
"message": "Unknown method __ge__ on Column[int]"
},
{
"type": "Warning",
"location": {
"start": [
19,
4
],
"end": [
19,
14
]
},
"message": "Unknown method __ge__ on Column[float]"
},
{
"type": "Warning",
"location": {
"start": [
20,
4
],
"end": [
20,
14
]
},
"message": "Unknown method __eq__ on Column[int]"
},
{
"type": "Warning",
"location": {
"start": [
20,
4
],
"end": [
20,
14
]
},
"message": "Unknown method __eq__ on Column[float]"
},
{
"type": "Warning",
"location": {
"start": [
21,
4
],
"end": [
21,
14
]
},
"message": "Unknown method __eq__ on Column[int]"
},
{
"type": "Warning",
"location": {
"start": [
21,
4
],
"end": [
21,
14
]
},
"message": "Unknown method __eq__ on Column[float]"
}
],
"diagnostics": [],
"judgments": [
{
"location": {
@@ -983,14 +814,18 @@
"index": 0,
"name": "a",
"type": {
"type": {}
"type": {
"name": "bool"
}
}
},
{
"index": 1,
"name": "b",
"type": {
"type": {}
"type": {
"name": "bool"
}
}
}
]
@@ -1083,14 +918,18 @@
"index": 0,
"name": "a",
"type": {
"type": {}
"type": {
"name": "bool"
}
}
},
{
"index": 1,
"name": "b",
"type": {
"type": {}
"type": {
"name": "bool"
}
}
}
]
@@ -1183,14 +1022,18 @@
"index": 0,
"name": "a",
"type": {
"type": {}
"type": {
"name": "bool"
}
}
},
{
"index": 1,
"name": "b",
"type": {
"type": {}
"type": {
"name": "bool"
}
}
}
]
@@ -1283,14 +1126,18 @@
"index": 0,
"name": "a",
"type": {
"type": {}
"type": {
"name": "bool"
}
}
},
{
"index": 1,
"name": "b",
"type": {
"type": {}
"type": {
"name": "bool"
}
}
}
]
@@ -1383,14 +1230,18 @@
"index": 0,
"name": "a",
"type": {
"type": {}
"type": {
"name": "bool"
}
}
},
{
"index": 1,
"name": "b",
"type": {
"type": {}
"type": {
"name": "bool"
}
}
}
]
@@ -1483,14 +1334,18 @@
"index": 0,
"name": "a",
"type": {
"type": {}
"type": {
"name": "bool"
}
}
},
{
"index": 1,
"name": "b",
"type": {
"type": {}
"type": {
"name": "bool"
}
}
}
]