Skip to content

Commit

Permalink
fix(exasol): properly handle returning BIGINT values
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrist committed Aug 19, 2024
1 parent 49b66e2 commit 2c84722
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
9 changes: 9 additions & 0 deletions ibis/backends/exasol/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ def convert_String(cls, s, dtype, pandas_type):
else:
return s

@classmethod
def convert_Int64(cls, s, dtype, pandas_dtype):
if s.dtype == "object":
# exasol returns BIGINT types as strings (or None for NULL).
# s.astype("int64") will fail in this case, using `Series.map`
# is the best we can do.
return s.map(int, na_action="ignore")
return s if s.dtype == pandas_dtype else s.astype(pandas_dtype)

@classmethod
def convert_Interval(cls, s, dtype, pandas_dtype):
def parse_timedelta(value):
Expand Down
7 changes: 1 addition & 6 deletions ibis/backends/tests/test_conditionals.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ def test_value_cases_scalar(con, inp, exp):
assert result == exp


@pytest.mark.notimpl(
"exasol",
reason="the int64 RBI column is .to_pandas()ed to an object column, which is incomparable to ints",
raises=AssertionError,
)
def test_value_cases_column(batting):
np = pytest.importorskip("numpy")

Expand Down Expand Up @@ -124,7 +119,7 @@ def test_ibis_cases_scalar():


@pytest.mark.notimpl(
["sqlite", "exasol"],
["sqlite"],
reason="the int64 RBI column is .to_pandas()ed to an object column, which is incomparable to 5",
raises=TypeError,
)
Expand Down
2 changes: 1 addition & 1 deletion ibis/backends/tests/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ def test_order_by_nulls(con, op, nulls_first, expected):

@pytest.mark.notimpl(["druid"])
@pytest.mark.never(
["exasol", "mysql"],
["mysql"],
raises=AssertionError,
reason="someone decided a long time ago that 'A' = 'a' is true in these systems",
)
Expand Down
10 changes: 1 addition & 9 deletions ibis/backends/tests/test_join.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,7 @@ def check_eq(left, right, how, **kwargs):
"left",
param(
"right",
marks=[
pytest.mark.notimpl(
["exasol"], raises=AssertionError, reasons="results don't match"
),
sqlite_right_or_full_mark,
],
marks=[sqlite_right_or_full_mark],
),
param(
"outer",
Expand All @@ -67,9 +62,6 @@ def check_eq(left, right, how, **kwargs):
pytest.mark.notimpl(["mysql"]),
sqlite_right_or_full_mark,
pytest.mark.xfail_version(datafusion=["datafusion<31"]),
pytest.mark.notimpl(
["exasol"], raises=AssertionError, reasons="results don't match"
),
],
),
],
Expand Down

0 comments on commit 2c84722

Please sign in to comment.