Skip to content

Commit

Permalink
test(postgres): use new imports
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Jan 16, 2025
1 parent 55e510e commit fda0c7c
Show file tree
Hide file tree
Showing 12 changed files with 106 additions and 113 deletions.
12 changes: 6 additions & 6 deletions ibis/backends/tests/test_aggregation.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
MySQLNotSupportedError,
OracleDatabaseError,
PolarsInvalidOperationError,
PsycoPgInternalError,
PsycoPg2InternalError,
Py4JError,
Py4JJavaError,
PyAthenaOperationalError,
Expand Down Expand Up @@ -963,7 +963,7 @@ def test_approx_quantile(con, filtered, multi):
),
pytest.mark.notimpl(
["risingwave"],
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason="function covar_pop(integer, integer) does not exist",
),
],
Expand All @@ -983,7 +983,7 @@ def test_approx_quantile(con, filtered, multi):
),
pytest.mark.notimpl(
["risingwave"],
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason="function covar_pop(integer, integer) does not exist",
),
],
Expand All @@ -1005,7 +1005,7 @@ def test_approx_quantile(con, filtered, multi):
),
pytest.mark.notimpl(
["risingwave"],
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason="function covar_pop(integer, integer) does not exist",
),
],
Expand Down Expand Up @@ -1062,7 +1062,7 @@ def test_approx_quantile(con, filtered, multi):
),
pytest.mark.notimpl(
["risingwave"],
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason="function covar_pop(integer, integer) does not exist",
),
],
Expand All @@ -1088,7 +1088,7 @@ def test_approx_quantile(con, filtered, multi):
),
pytest.mark.notimpl(
["risingwave"],
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason="function covar_pop(integer, integer) does not exist",
),
],
Expand Down
65 changes: 29 additions & 36 deletions ibis/backends/tests/test_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@
GoogleBadRequest,
MySQLOperationalError,
PolarsComputeError,
PsycoPgIndeterminateDatatype,
PsycoPg2ArraySubscriptError,
PsycoPg2IndeterminateDatatype,
PsycoPg2InternalError,
PsycoPg2ProgrammingError,
PsycoPg2SyntaxError,
PsycoPgInternalError,
PsycoPgInvalidTextRepresentation,
PsycoPgProgrammingError,
PsycoPgSyntaxError,
Py4JJavaError,
PyAthenaDatabaseError,
Expand Down Expand Up @@ -504,7 +506,7 @@ def test_array_slice(backend, start, stop):
)
@pytest.mark.notimpl(
["risingwave"],
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason="TODO(Kexiang): seems a bug",
)
@pytest.mark.notimpl(["athena"], raises=PyAthenaDatabaseError)
Expand Down Expand Up @@ -563,7 +565,7 @@ def test_array_map(con, input, output, func):
)
@pytest.mark.notimpl(
["risingwave"],
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason="TODO(Kexiang): seems a bug",
)
@pytest.mark.notimpl(["athena"], raises=PyAthenaDatabaseError)
Expand Down Expand Up @@ -644,7 +646,7 @@ def test_array_map_with_index(con, input, output, func):
)
@pytest.mark.notyet(
"risingwave",
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason="no support for not null column constraint",
)
@pytest.mark.parametrize(
Expand Down Expand Up @@ -691,7 +693,7 @@ def test_array_filter(con, input, output, predicate):
)
@pytest.mark.notyet(
"risingwave",
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason="no support for not null column constraint",
)
@pytest.mark.parametrize(
Expand Down Expand Up @@ -738,7 +740,7 @@ def test_array_filter_with_index(con, input, output, predicate):
)
@pytest.mark.notyet(
"risingwave",
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason="no support for not null column constraint",
)
@pytest.mark.parametrize(
Expand Down Expand Up @@ -1114,8 +1116,8 @@ def test_unnest_struct(con):


@builtin_array
@pytest.mark.notimpl(["postgres"], raises=PsycoPgSyntaxError)
@pytest.mark.notimpl(["risingwave"], raises=PsycoPgInternalError)
@pytest.mark.notimpl(["postgres"], raises=PsycoPg2SyntaxError)
@pytest.mark.notimpl(["risingwave"], raises=PsycoPg2InternalError)
@pytest.mark.notimpl(
["trino"], reason="inserting maps into structs doesn't work", raises=TrinoUserError
)
Expand Down Expand Up @@ -1205,8 +1207,8 @@ def test_zip_null(con, fn):


@builtin_array
@pytest.mark.notimpl(["postgres"], raises=PsycoPgSyntaxError)
@pytest.mark.notimpl(["risingwave"], raises=PsycoPgProgrammingError)
@pytest.mark.notimpl(["postgres"], raises=PsycoPg2SyntaxError)
@pytest.mark.notimpl(["risingwave"], raises=PsycoPg2ProgrammingError)
@pytest.mark.notimpl(["datafusion"], raises=Exception, reason="not yet supported")
@pytest.mark.notimpl(
["polars"],
Expand Down Expand Up @@ -1276,21 +1278,12 @@ def flatten_data():
["bigquery"], reason="BigQuery doesn't support arrays of arrays", raises=TypeError
)
@pytest.mark.notyet(
["postgres"],
["postgres", "risingwave"],
reason="Postgres doesn't truly support arrays of arrays",
raises=(
com.OperationNotDefinedError,
PsycoPgIndeterminateDatatype,
PsycoPgInternalError,
),
)
@pytest.mark.notyet(
["risingwave"],
reason="Risingwave doesn't truly support arrays of arrays",
raises=(
com.OperationNotDefinedError,
PsycoPgIndeterminateDatatype,
PsycoPgInternalError,
PsycoPg2IndeterminateDatatype,
PsycoPg2InternalError,
),
)
@pytest.mark.parametrize(
Expand Down Expand Up @@ -1397,7 +1390,7 @@ def test_range_start_stop_step(con, start, stop, step):
@pytest.mark.notimpl(["flink"], raises=com.OperationNotDefinedError)
@pytest.mark.never(
["risingwave"],
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason="Invalid parameter step: step size cannot equal zero",
)
def test_range_start_stop_step_zero(con, start, stop):
Expand Down Expand Up @@ -1430,7 +1423,7 @@ def test_unnest_empty_array(con):
@pytest.mark.notimpl(["sqlite"], raises=com.UnsupportedBackendType)
@pytest.mark.notyet(
"risingwave",
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason="no support for not null column constraint",
)
@pytest.mark.notimpl(["athena"], raises=PyAthenaDatabaseError)
Expand Down Expand Up @@ -1513,7 +1506,7 @@ def swap(token):
id="pos",
marks=pytest.mark.notimpl(
["risingwave"],
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason="function make_interval() does not exist",
),
),
Expand All @@ -1531,7 +1524,7 @@ def swap(token):
),
pytest.mark.notimpl(
["risingwave"],
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason="function neg(interval) does not exist",
),
],
Expand All @@ -1551,7 +1544,7 @@ def swap(token):
),
pytest.mark.notimpl(
["risingwave"],
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason="function neg(interval) does not exist",
),
],
Expand Down Expand Up @@ -1583,7 +1576,7 @@ def test_timestamp_range(con, start, stop, step, freq, tzinfo):
pytest.mark.notyet(["polars"], raises=PolarsComputeError),
pytest.mark.notyet(
["risingwave"],
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason="function make_interval() does not exist",
),
],
Expand All @@ -1602,7 +1595,7 @@ def test_timestamp_range(con, start, stop, step, freq, tzinfo):
),
pytest.mark.notyet(
["risingwave"],
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason="function neg(interval) does not exist",
),
],
Expand Down Expand Up @@ -1758,7 +1751,7 @@ def test_table_unnest_with_keep_empty(con):
["datafusion", "polars", "flink"], raises=com.OperationNotDefinedError
)
@pytest.mark.notyet(
["risingwave"], raises=PsycoPgInternalError, reason="not supported in risingwave"
["risingwave"], raises=PsycoPg2InternalError, reason="not supported in risingwave"
)
@pytest.mark.notimpl(
["athena"],
Expand All @@ -1778,10 +1771,10 @@ def test_table_unnest_column_expr(backend):
)
@pytest.mark.notimpl(["trino"], raises=TrinoUserError)
@pytest.mark.notimpl(["athena"], raises=PyAthenaOperationalError)
@pytest.mark.notimpl(["postgres"], raises=PsycoPgSyntaxError)
@pytest.mark.notimpl(["risingwave"], raises=PsycoPgProgrammingError)
@pytest.mark.notimpl(["postgres"], raises=PsycoPg2SyntaxError)
@pytest.mark.notimpl(["risingwave"], raises=PsycoPg2ProgrammingError)
@pytest.mark.notyet(
["risingwave"], raises=PsycoPgInternalError, reason="not supported in risingwave"
["risingwave"], raises=PsycoPg2InternalError, reason="not supported in risingwave"
)
def test_table_unnest_array_of_struct_of_array(con):
t = ibis.memtable(
Expand Down Expand Up @@ -1896,7 +1889,7 @@ def test_array_agg_bool(con, data, agg, baseline_func):

@pytest.mark.notyet(
["postgres"],
raises=PsycoPgInvalidTextRepresentation,
raises=PsycoPg2ArraySubscriptError,
reason="all dimensions must match in size",
)
@pytest.mark.notimpl(["risingwave", "flink"], raises=com.OperationNotDefinedError)
Expand Down
16 changes: 8 additions & 8 deletions ibis/backends/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
ExaQueryError,
ImpalaHiveServer2Error,
OracleDatabaseError,
PsycoPgInternalError,
PsycoPgUndefinedObject,
PsycoPg2InternalError,
PsycoPg2UndefinedObject,
Py4JJavaError,
PyAthenaDatabaseError,
PyODBCProgrammingError,
Expand Down Expand Up @@ -415,7 +415,7 @@ def test_rename_table(con, temp_table, temp_table_orig):
)
@pytest.mark.never(
["risingwave"],
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason='Feature is not yet implemented: column constraints "NOT NULL"',
)
def test_nullable_input_output(con, temp_table):
Expand Down Expand Up @@ -538,7 +538,7 @@ def test_insert_no_overwrite_from_dataframe(
@pytest.mark.notimpl(["polars"], reason="`insert` method not implemented")
@pytest.mark.notyet(
["risingwave"],
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason="truncate not supported upstream",
)
@pytest.mark.notyet(
Expand Down Expand Up @@ -584,7 +584,7 @@ def test_insert_no_overwrite_from_expr(
)
@pytest.mark.notyet(
["risingwave"],
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason="truncate not supported upstream",
)
def test_insert_overwrite_from_expr(
Expand All @@ -608,7 +608,7 @@ def test_insert_overwrite_from_expr(
)
@pytest.mark.notyet(
["risingwave"],
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason="truncate not supported upstream",
)
def test_insert_overwrite_from_list(con, employee_data_1_temp_table):
Expand Down Expand Up @@ -725,7 +725,7 @@ def test_list_database_contents(con):
@pytest.mark.notyet(["databricks"], raises=DatabricksServerOperationError)
@pytest.mark.notyet(["bigquery"], raises=com.UnsupportedBackendType)
@pytest.mark.notyet(
["postgres"], raises=PsycoPgUndefinedObject, reason="no unsigned int types"
["postgres"], raises=PsycoPg2UndefinedObject, reason="no unsigned int types"
)
@pytest.mark.notyet(
["oracle"], raises=OracleDatabaseError, reason="no unsigned int types"
Expand All @@ -737,7 +737,7 @@ def test_list_database_contents(con):
@pytest.mark.notyet(["impala"], raises=ImpalaHiveServer2Error)
@pytest.mark.notyet(
["risingwave"],
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason="unsigned integers are not supported",
)
@pytest.mark.notimpl(
Expand Down
14 changes: 7 additions & 7 deletions ibis/backends/tests/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
MySQLProgrammingError,
OracleDatabaseError,
PolarsInvalidOperationError,
PsycoPgInternalError,
PsycoPgSyntaxError,
PsycoPg2InternalError,
PsycoPg2SyntaxError,
Py4JJavaError,
PyAthenaDatabaseError,
PyAthenaOperationalError,
Expand Down Expand Up @@ -1132,7 +1132,7 @@ def test_typeof(con):
@pytest.mark.notyet(["exasol"], raises=ExaQueryError, reason="not supported by exasol")
@pytest.mark.notyet(
["risingwave"],
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason="https://github.com/risingwavelabs/risingwave/issues/1343",
)
@pytest.mark.notyet(
Expand Down Expand Up @@ -1735,8 +1735,8 @@ def hash_256(col):
pytest.mark.notimpl(["flink"], raises=Py4JJavaError),
pytest.mark.notimpl(["druid"], raises=PyDruidProgrammingError),
pytest.mark.notimpl(["oracle"], raises=OracleDatabaseError),
pytest.mark.notimpl(["postgres"], raises=PsycoPgSyntaxError),
pytest.mark.notimpl(["risingwave"], raises=PsycoPgInternalError),
pytest.mark.notimpl(["postgres"], raises=PsycoPg2SyntaxError),
pytest.mark.notimpl(["risingwave"], raises=PsycoPg2InternalError),
pytest.mark.notimpl(["snowflake"], raises=AssertionError),
pytest.mark.never(
["datafusion", "exasol", "impala", "mssql", "mysql", "sqlite"],
Expand Down Expand Up @@ -2073,7 +2073,7 @@ def test_static_table_slice(backend, slc, expected_count_fn):
)
@pytest.mark.notimpl(
["risingwave"],
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason="risingwave doesn't support limit/offset",
)
@pytest.mark.notyet(
Expand Down Expand Up @@ -2174,7 +2174,7 @@ def test_dynamic_table_slice(backend, slc, expected_count_fn):
)
@pytest.mark.notimpl(
["risingwave"],
raises=PsycoPgInternalError,
raises=PsycoPg2InternalError,
reason="risingwave doesn't support limit/offset",
)
def test_dynamic_table_slice_with_computed_offset(backend):
Expand Down
Loading

0 comments on commit fda0c7c

Please sign in to comment.