Skip to content

Commit

Permalink
test(temporal): unxfail tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Aug 8, 2024
1 parent b0bf991 commit 95f692e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 37 deletions.
3 changes: 2 additions & 1 deletion ibis/backends/tests/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@

try:
from oracledb.exceptions import DatabaseError as OracleDatabaseError
from oracledb.exceptions import InterfaceError as OracleInterfaceError

Check warning on line 136 in ibis/backends/tests/errors.py

View check run for this annotation

Codecov / codecov/patch

ibis/backends/tests/errors.py#L136

Added line #L136 was not covered by tests
except ImportError:
OracleDatabaseError = None
OracleDatabaseError = OracleInterfaceError = None

try:
from pyodbc import DataError as PyODBCDataError
Expand Down
62 changes: 26 additions & 36 deletions ibis/backends/tests/test_temporal.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
MySQLOperationalError,
MySQLProgrammingError,
OracleDatabaseError,
OracleInterfaceError,
PolarsInvalidOperationError,
PolarsPanicException,
PsycoPg2InternalError,
Expand Down Expand Up @@ -500,6 +501,11 @@ def test_date_truncate(backend, alltypes, df, unit):
raises=com.UnsupportedOperationError,
reason="month not implemented",
),
pytest.mark.notyet(
["oracle"],
raises=OracleInterfaceError,
reason="cursor not open, probably a bug in the sql generated",
),
],
),
param(
Expand All @@ -512,11 +518,8 @@ def test_date_truncate(backend, alltypes, df, unit):
raises=ValueError,
reason="Metadata inference failed in `add`.",
),
pytest.mark.notyet(
["trino"],
raises=com.UnsupportedOperationError,
reason="week not implemented",
),
pytest.mark.notyet(["trino"], raises=com.UnsupportedOperationError),
pytest.mark.notyet(["oracle"], raises=com.UnsupportedArgumentError),
pytest.mark.notyet(
["flink"],
raises=Py4JJavaError,
Expand Down Expand Up @@ -579,8 +582,7 @@ def test_date_truncate(backend, alltypes, df, unit):
],
)
@pytest.mark.notimpl(
["datafusion", "sqlite", "mssql", "oracle", "druid", "exasol"],
raises=com.OperationNotDefinedError,
["datafusion", "sqlite", "druid", "exasol"], raises=com.OperationNotDefinedError
)
def test_integer_to_interval_timestamp(
backend, con, alltypes, df, unit, displacement_type
Expand Down Expand Up @@ -614,12 +616,20 @@ def convert_to_offset(offset, displacement_type=displacement_type):
param("Q", marks=pytest.mark.xfail),
param(
"M",
marks=pytest.mark.notyet(["trino"], raises=com.UnsupportedOperationError),
marks=[
pytest.mark.notyet(["trino"], raises=com.UnsupportedOperationError),
pytest.mark.notyet(
["oracle"],
raises=OracleInterfaceError,
reason="cursor not open, probably a bug in the sql generated",
),
],
),
param(
"W",
marks=[
pytest.mark.notyet(["trino"], raises=com.UnsupportedOperationError),
pytest.mark.notyet(["oracle"], raises=com.UnsupportedArgumentError),
pytest.mark.notimpl(
["risingwave"],
raises=PsycoPg2InternalError,
Expand All @@ -631,32 +641,21 @@ def convert_to_offset(offset, displacement_type=displacement_type):
],
)
@pytest.mark.notimpl(
[
"datafusion",
"flink",
"impala",
"mysql",
"sqlite",
"polars",
"mssql",
"druid",
"oracle",
],
["datafusion", "flink", "impala", "sqlite", "polars", "druid"],
raises=com.OperationNotDefinedError,
)
@pytest.mark.notimpl(
[
"sqlite",
],
["sqlite"],
raises=(com.UnsupportedOperationError, com.OperationNotDefinedError),
reason="Handling unsupported op error for DateAdd with weeks",
)
@pytest.mark.notimpl(["exasol"], raises=com.OperationNotDefinedError)
def test_integer_to_interval_date(backend, con, alltypes, df, unit):
interval = alltypes.int_col.to_interval(unit=unit)
array = alltypes.date_string_col.split("/")
month, day, year = array[0], array[1], array[2]
date_col = ibis.literal("-").join(["20" + year, month, day]).cast("date")
month = alltypes.date_string_col[:2]
day = alltypes.date_string_col[3:5]
year = alltypes.date_string_col[6:8]
date_col = ("20" + year + "-" + month + "-" + day).cast("date")
expr = (date_col + interval).name("tmp")

with warnings.catch_warnings():
Expand Down Expand Up @@ -1727,9 +1726,6 @@ def test_timestamp_column_from_ymdhms(backend, con, alltypes, df):
backend.assert_series_equal(golden, result.timestamp_col)


@pytest.mark.notimpl(
["oracle"], raises=OracleDatabaseError, reason="ORA-01861 literal does not match"
)
def test_date_scalar_from_iso(con):
expr = ibis.literal("2022-02-24")
expr2 = ibis.date(expr)
Expand All @@ -1739,11 +1735,6 @@ def test_date_scalar_from_iso(con):


@pytest.mark.notimpl(["mssql"], raises=com.OperationNotDefinedError)
@pytest.mark.notyet(
["oracle"],
raises=OracleDatabaseError,
reason="ORA-22849 type CLOB is not supported",
)
@pytest.mark.notimpl(["exasol"], raises=AssertionError, strict=False)
def test_date_column_from_iso(backend, con, alltypes, df):
expr = (
Expand Down Expand Up @@ -1830,7 +1821,6 @@ def build_date_col(t):

@pytest.mark.notimpl(["mssql"], raises=com.OperationNotDefinedError)
@pytest.mark.notimpl(["druid"], raises=PyDruidProgrammingError)
@pytest.mark.notimpl(["oracle"], raises=OracleDatabaseError)
@pytest.mark.parametrize(
("left_fn", "right_fn"),
[
Expand Down Expand Up @@ -2064,8 +2054,8 @@ def test_delta(con, start, end, unit, expected):
),
pytest.mark.notimpl(
["oracle"],
raises=com.UnsupportedOperationError,
reason="backend doesn't support sub-second interval precision",
raises=com.OperationNotDefinedError,
reason="TimestampBucket not implemented",
),
],
id="milliseconds",
Expand Down

0 comments on commit 95f692e

Please sign in to comment.