Skip to content

Commit e20bdad

Browse files
committed
fix(exasol): properly handle returning BIGINT values
1 parent a24200c commit e20bdad

File tree

4 files changed

+12
-16
lines changed

4 files changed

+12
-16
lines changed

ibis/backends/exasol/converter.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ def convert_String(cls, s, dtype, pandas_type):
1313
else:
1414
return s
1515

16+
@classmethod
17+
def convert_Int64(cls, s, dtype, pandas_dtype):
18+
if s.dtype == "object":
19+
# exasol returns BIGINT types as strings (or None for NULL).
20+
# s.astype("int64") will fail in this case, using `Series.map`
21+
# is the best we can do.
22+
return s.map(int, na_action="ignore")
23+
return s if s.dtype == pandas_dtype else s.astype(pandas_dtype)
24+
1625
@classmethod
1726
def convert_Interval(cls, s, dtype, pandas_dtype):
1827
def parse_timedelta(value):

ibis/backends/tests/test_conditionals.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,6 @@ def test_value_cases_scalar(con, inp, exp):
9090
assert result == exp
9191

9292

93-
@pytest.mark.notimpl(
94-
"exasol",
95-
reason="the int64 RBI column is .to_pandas()ed to an object column, which is incomparable to ints",
96-
raises=AssertionError,
97-
)
9893
def test_value_cases_column(batting):
9994
np = pytest.importorskip("numpy")
10095

@@ -124,7 +119,7 @@ def test_ibis_cases_scalar():
124119

125120

126121
@pytest.mark.notimpl(
127-
["sqlite", "exasol"],
122+
["sqlite"],
128123
reason="the int64 RBI column is .to_pandas()ed to an object column, which is incomparable to 5",
129124
raises=TypeError,
130125
)

ibis/backends/tests/test_generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ def test_order_by_nulls(con, op, nulls_first, expected):
637637

638638
@pytest.mark.notimpl(["druid"])
639639
@pytest.mark.never(
640-
["exasol", "mysql"],
640+
["mysql"],
641641
raises=AssertionError,
642642
reason="someone decided a long time ago that 'A' = 'a' is true in these systems",
643643
)

ibis/backends/tests/test_join.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,7 @@ def check_eq(left, right, how, **kwargs):
5151
"left",
5252
param(
5353
"right",
54-
marks=[
55-
pytest.mark.notimpl(
56-
["exasol"], raises=AssertionError, reasons="results don't match"
57-
),
58-
sqlite_right_or_full_mark,
59-
],
54+
marks=[sqlite_right_or_full_mark],
6055
),
6156
param(
6257
"outer",
@@ -67,9 +62,6 @@ def check_eq(left, right, how, **kwargs):
6762
pytest.mark.notimpl(["mysql"]),
6863
sqlite_right_or_full_mark,
6964
pytest.mark.xfail_version(datafusion=["datafusion<31"]),
70-
pytest.mark.notimpl(
71-
["exasol"], raises=AssertionError, reasons="results don't match"
72-
),
7365
],
7466
),
7567
],

0 commit comments

Comments
 (0)