Skip to content

Commit 105aa15

Browse files
mihaibudiugz
authored andcommitted
[python] Test case for #5520 (incorrect serialization of infinity)
Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
1 parent 9047bad commit 105aa15

4 files changed

Lines changed: 18 additions & 9 deletions

File tree

python/feldera/pipeline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ def query_arrow(self, query: str) -> Generator[pa.RecordBatch, None, None]:
10451045
def query_arrow_dicts(self, query: str) -> Generator[Mapping[str, Any], None, None]:
10461046
"""
10471047
Executes an ad-hoc SQL query on this pipeline and returns a generator
1048-
that yields the result as a list of Dictionaries.
1048+
that yields the result as a sequence of Dictionaries.
10491049
10501050
Note:
10511051
You can only ``SELECT`` from materialized tables and views.

python/tests/runtime/test_doubles.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def test_local(self):
4848

4949
pipeline.wait_for_completion()
5050
data = list(pipeline.query_arrow_dicts("SELECT * FROM v"))
51-
print(data)
5251
assert len(data) == 1
5352
assert data[0]["one"] == float("inf")
5453
assert math.isnan(data[0]["zero"])

python/tests/runtime_aggtest/aggregate_tests4/test_map_arg_max.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
from tests.runtime_aggtest.aggtst_base import TstView
22
import pyarrow as pa
33

4-
5-
def mkmap(d):
6-
return pa.array(d, type=pa.map_(pa.string(), pa.int64())).to_pylist()
7-
8-
94
class aggtst_map_arg_max_value(TstView):
105
def __init__(self):
116
# checked manually

python/tests/runtime_aggtest/unsigned_int_tests/test_un_int_arith_fn.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
from tests.runtime_aggtest.aggtst_base import TstView
1+
from tests.runtime_aggtest.aggtst_base import TstTable, TstView
22

33

4-
# NOTE: SINH, COSH, EXP tests are supplied smaller input due to: https://github.com/feldera/feldera/issues/5520
54
# ABS
65
class un_int_abs(TstView):
76
def __init__(self):
@@ -366,6 +365,22 @@ def __init__(self):
366365
WHERE id = 1"""
367366

368367

368+
369+
class tableIssue5520(TstTable):
370+
def __init__(self):
371+
self.sql = "CREATE TABLE tbl5520(dbl DOUBLE);"
372+
self.data = [ { "dbl": 10192.0 } ]
373+
374+
375+
# SINH
376+
class issue5520(TstView):
377+
def __init__(self):
378+
self.data = [{ "d": "Infinity" }]
379+
self.sql = """CREATE MATERIALIZED VIEW issue5520view AS SELECT
380+
CAST(SINH(dbl) AS VARCHAR) AS d
381+
FROM tbl5520"""
382+
383+
369384
# SQRT
370385
class un_int_sqrt(TstView):
371386
def __init__(self):

0 commit comments

Comments
 (0)