Skip to content

Commit 8af5d97

Browse files
committed
test(postgres): use new imports
1 parent eacd5eb commit 8af5d97

12 files changed

+106
-113
lines changed

ibis/backends/tests/test_aggregation.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
MySQLNotSupportedError,
2222
OracleDatabaseError,
2323
PolarsInvalidOperationError,
24-
PsycoPgInternalError,
24+
PsycoPg2InternalError,
2525
Py4JError,
2626
Py4JJavaError,
2727
PyAthenaOperationalError,
@@ -963,7 +963,7 @@ def test_approx_quantile(con, filtered, multi):
963963
),
964964
pytest.mark.notimpl(
965965
["risingwave"],
966-
raises=PsycoPgInternalError,
966+
raises=PsycoPg2InternalError,
967967
reason="function covar_pop(integer, integer) does not exist",
968968
),
969969
],
@@ -983,7 +983,7 @@ def test_approx_quantile(con, filtered, multi):
983983
),
984984
pytest.mark.notimpl(
985985
["risingwave"],
986-
raises=PsycoPgInternalError,
986+
raises=PsycoPg2InternalError,
987987
reason="function covar_pop(integer, integer) does not exist",
988988
),
989989
],
@@ -1005,7 +1005,7 @@ def test_approx_quantile(con, filtered, multi):
10051005
),
10061006
pytest.mark.notimpl(
10071007
["risingwave"],
1008-
raises=PsycoPgInternalError,
1008+
raises=PsycoPg2InternalError,
10091009
reason="function covar_pop(integer, integer) does not exist",
10101010
),
10111011
],
@@ -1062,7 +1062,7 @@ def test_approx_quantile(con, filtered, multi):
10621062
),
10631063
pytest.mark.notimpl(
10641064
["risingwave"],
1065-
raises=PsycoPgInternalError,
1065+
raises=PsycoPg2InternalError,
10661066
reason="function covar_pop(integer, integer) does not exist",
10671067
),
10681068
],
@@ -1088,7 +1088,7 @@ def test_approx_quantile(con, filtered, multi):
10881088
),
10891089
pytest.mark.notimpl(
10901090
["risingwave"],
1091-
raises=PsycoPgInternalError,
1091+
raises=PsycoPg2InternalError,
10921092
reason="function covar_pop(integer, integer) does not exist",
10931093
),
10941094
],

ibis/backends/tests/test_array.py

Lines changed: 29 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@
2222
GoogleBadRequest,
2323
MySQLOperationalError,
2424
PolarsComputeError,
25-
PsycoPgIndeterminateDatatype,
25+
PsycoPg2ArraySubscriptError,
26+
PsycoPg2IndeterminateDatatype,
27+
PsycoPg2InternalError,
28+
PsycoPg2ProgrammingError,
29+
PsycoPg2SyntaxError,
2630
PsycoPgInternalError,
27-
PsycoPgInvalidTextRepresentation,
28-
PsycoPgProgrammingError,
2931
PsycoPgSyntaxError,
3032
Py4JJavaError,
3133
PyAthenaDatabaseError,
@@ -504,7 +506,7 @@ def test_array_slice(backend, start, stop):
504506
)
505507
@pytest.mark.notimpl(
506508
["risingwave"],
507-
raises=PsycoPgInternalError,
509+
raises=PsycoPg2InternalError,
508510
reason="TODO(Kexiang): seems a bug",
509511
)
510512
@pytest.mark.notimpl(["athena"], raises=PyAthenaDatabaseError)
@@ -563,7 +565,7 @@ def test_array_map(con, input, output, func):
563565
)
564566
@pytest.mark.notimpl(
565567
["risingwave"],
566-
raises=PsycoPgInternalError,
568+
raises=PsycoPg2InternalError,
567569
reason="TODO(Kexiang): seems a bug",
568570
)
569571
@pytest.mark.notimpl(["athena"], raises=PyAthenaDatabaseError)
@@ -644,7 +646,7 @@ def test_array_map_with_index(con, input, output, func):
644646
)
645647
@pytest.mark.notyet(
646648
"risingwave",
647-
raises=PsycoPgInternalError,
649+
raises=PsycoPg2InternalError,
648650
reason="no support for not null column constraint",
649651
)
650652
@pytest.mark.parametrize(
@@ -691,7 +693,7 @@ def test_array_filter(con, input, output, predicate):
691693
)
692694
@pytest.mark.notyet(
693695
"risingwave",
694-
raises=PsycoPgInternalError,
696+
raises=PsycoPg2InternalError,
695697
reason="no support for not null column constraint",
696698
)
697699
@pytest.mark.parametrize(
@@ -738,7 +740,7 @@ def test_array_filter_with_index(con, input, output, predicate):
738740
)
739741
@pytest.mark.notyet(
740742
"risingwave",
741-
raises=PsycoPgInternalError,
743+
raises=PsycoPg2InternalError,
742744
reason="no support for not null column constraint",
743745
)
744746
@pytest.mark.parametrize(
@@ -1114,8 +1116,8 @@ def test_unnest_struct(con):
11141116

11151117

11161118
@builtin_array
1117-
@pytest.mark.notimpl(["postgres"], raises=PsycoPgSyntaxError)
1118-
@pytest.mark.notimpl(["risingwave"], raises=PsycoPgInternalError)
1119+
@pytest.mark.notimpl(["postgres"], raises=PsycoPg2SyntaxError)
1120+
@pytest.mark.notimpl(["risingwave"], raises=PsycoPg2InternalError)
11191121
@pytest.mark.notimpl(
11201122
["trino"], reason="inserting maps into structs doesn't work", raises=TrinoUserError
11211123
)
@@ -1205,8 +1207,8 @@ def test_zip_null(con, fn):
12051207

12061208

12071209
@builtin_array
1208-
@pytest.mark.notimpl(["postgres"], raises=PsycoPgSyntaxError)
1209-
@pytest.mark.notimpl(["risingwave"], raises=PsycoPgProgrammingError)
1210+
@pytest.mark.notimpl(["postgres"], raises=PsycoPg2SyntaxError)
1211+
@pytest.mark.notimpl(["risingwave"], raises=PsycoPg2ProgrammingError)
12101212
@pytest.mark.notimpl(["datafusion"], raises=Exception, reason="not yet supported")
12111213
@pytest.mark.notimpl(
12121214
["polars"],
@@ -1276,21 +1278,12 @@ def flatten_data():
12761278
["bigquery"], reason="BigQuery doesn't support arrays of arrays", raises=TypeError
12771279
)
12781280
@pytest.mark.notyet(
1279-
["postgres"],
1281+
["postgres", "risingwave"],
12801282
reason="Postgres doesn't truly support arrays of arrays",
12811283
raises=(
12821284
com.OperationNotDefinedError,
1283-
PsycoPgIndeterminateDatatype,
1284-
PsycoPgInternalError,
1285-
),
1286-
)
1287-
@pytest.mark.notyet(
1288-
["risingwave"],
1289-
reason="Risingwave doesn't truly support arrays of arrays",
1290-
raises=(
1291-
com.OperationNotDefinedError,
1292-
PsycoPgIndeterminateDatatype,
1293-
PsycoPgInternalError,
1285+
PsycoPg2IndeterminateDatatype,
1286+
PsycoPg2InternalError,
12941287
),
12951288
)
12961289
@pytest.mark.parametrize(
@@ -1397,7 +1390,7 @@ def test_range_start_stop_step(con, start, stop, step):
13971390
@pytest.mark.notimpl(["flink"], raises=com.OperationNotDefinedError)
13981391
@pytest.mark.never(
13991392
["risingwave"],
1400-
raises=PsycoPgInternalError,
1393+
raises=PsycoPg2InternalError,
14011394
reason="Invalid parameter step: step size cannot equal zero",
14021395
)
14031396
def test_range_start_stop_step_zero(con, start, stop):
@@ -1430,7 +1423,7 @@ def test_unnest_empty_array(con):
14301423
@pytest.mark.notimpl(["sqlite"], raises=com.UnsupportedBackendType)
14311424
@pytest.mark.notyet(
14321425
"risingwave",
1433-
raises=PsycoPgInternalError,
1426+
raises=PsycoPg2InternalError,
14341427
reason="no support for not null column constraint",
14351428
)
14361429
@pytest.mark.notimpl(["athena"], raises=PyAthenaDatabaseError)
@@ -1513,7 +1506,7 @@ def swap(token):
15131506
id="pos",
15141507
marks=pytest.mark.notimpl(
15151508
["risingwave"],
1516-
raises=PsycoPgInternalError,
1509+
raises=PsycoPg2InternalError,
15171510
reason="function make_interval() does not exist",
15181511
),
15191512
),
@@ -1531,7 +1524,7 @@ def swap(token):
15311524
),
15321525
pytest.mark.notimpl(
15331526
["risingwave"],
1534-
raises=PsycoPgInternalError,
1527+
raises=PsycoPg2InternalError,
15351528
reason="function neg(interval) does not exist",
15361529
),
15371530
],
@@ -1551,7 +1544,7 @@ def swap(token):
15511544
),
15521545
pytest.mark.notimpl(
15531546
["risingwave"],
1554-
raises=PsycoPgInternalError,
1547+
raises=PsycoPg2InternalError,
15551548
reason="function neg(interval) does not exist",
15561549
),
15571550
],
@@ -1583,7 +1576,7 @@ def test_timestamp_range(con, start, stop, step, freq, tzinfo):
15831576
pytest.mark.notyet(["polars"], raises=PolarsComputeError),
15841577
pytest.mark.notyet(
15851578
["risingwave"],
1586-
raises=PsycoPgInternalError,
1579+
raises=PsycoPg2InternalError,
15871580
reason="function make_interval() does not exist",
15881581
),
15891582
],
@@ -1602,7 +1595,7 @@ def test_timestamp_range(con, start, stop, step, freq, tzinfo):
16021595
),
16031596
pytest.mark.notyet(
16041597
["risingwave"],
1605-
raises=PsycoPgInternalError,
1598+
raises=PsycoPg2InternalError,
16061599
reason="function neg(interval) does not exist",
16071600
),
16081601
],
@@ -1758,7 +1751,7 @@ def test_table_unnest_with_keep_empty(con):
17581751
["datafusion", "polars", "flink"], raises=com.OperationNotDefinedError
17591752
)
17601753
@pytest.mark.notyet(
1761-
["risingwave"], raises=PsycoPgInternalError, reason="not supported in risingwave"
1754+
["risingwave"], raises=PsycoPg2InternalError, reason="not supported in risingwave"
17621755
)
17631756
@pytest.mark.notimpl(
17641757
["athena"],
@@ -1778,10 +1771,10 @@ def test_table_unnest_column_expr(backend):
17781771
)
17791772
@pytest.mark.notimpl(["trino"], raises=TrinoUserError)
17801773
@pytest.mark.notimpl(["athena"], raises=PyAthenaOperationalError)
1781-
@pytest.mark.notimpl(["postgres"], raises=PsycoPgSyntaxError)
1782-
@pytest.mark.notimpl(["risingwave"], raises=PsycoPgProgrammingError)
1774+
@pytest.mark.notimpl(["postgres"], raises=PsycoPg2SyntaxError)
1775+
@pytest.mark.notimpl(["risingwave"], raises=PsycoPg2ProgrammingError)
17831776
@pytest.mark.notyet(
1784-
["risingwave"], raises=PsycoPgInternalError, reason="not supported in risingwave"
1777+
["risingwave"], raises=PsycoPg2InternalError, reason="not supported in risingwave"
17851778
)
17861779
def test_table_unnest_array_of_struct_of_array(con):
17871780
t = ibis.memtable(
@@ -1896,7 +1889,7 @@ def test_array_agg_bool(con, data, agg, baseline_func):
18961889

18971890
@pytest.mark.notyet(
18981891
["postgres"],
1899-
raises=PsycoPgInvalidTextRepresentation,
1892+
raises=PsycoPg2ArraySubscriptError,
19001893
reason="all dimensions must match in size",
19011894
)
19021895
@pytest.mark.notimpl(["risingwave", "flink"], raises=com.OperationNotDefinedError)

ibis/backends/tests/test_client.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
ExaQueryError,
3232
ImpalaHiveServer2Error,
3333
OracleDatabaseError,
34-
PsycoPgInternalError,
35-
PsycoPgUndefinedObject,
34+
PsycoPg2InternalError,
35+
PsycoPg2UndefinedObject,
3636
Py4JJavaError,
3737
PyAthenaDatabaseError,
3838
PyODBCProgrammingError,
@@ -415,7 +415,7 @@ def test_rename_table(con, temp_table, temp_table_orig):
415415
)
416416
@pytest.mark.never(
417417
["risingwave"],
418-
raises=PsycoPgInternalError,
418+
raises=PsycoPg2InternalError,
419419
reason='Feature is not yet implemented: column constraints "NOT NULL"',
420420
)
421421
def test_nullable_input_output(con, temp_table):
@@ -538,7 +538,7 @@ def test_insert_no_overwrite_from_dataframe(
538538
@pytest.mark.notimpl(["polars"], reason="`insert` method not implemented")
539539
@pytest.mark.notyet(
540540
["risingwave"],
541-
raises=PsycoPgInternalError,
541+
raises=PsycoPg2InternalError,
542542
reason="truncate not supported upstream",
543543
)
544544
@pytest.mark.notyet(
@@ -584,7 +584,7 @@ def test_insert_no_overwrite_from_expr(
584584
)
585585
@pytest.mark.notyet(
586586
["risingwave"],
587-
raises=PsycoPgInternalError,
587+
raises=PsycoPg2InternalError,
588588
reason="truncate not supported upstream",
589589
)
590590
def test_insert_overwrite_from_expr(
@@ -608,7 +608,7 @@ def test_insert_overwrite_from_expr(
608608
)
609609
@pytest.mark.notyet(
610610
["risingwave"],
611-
raises=PsycoPgInternalError,
611+
raises=PsycoPg2InternalError,
612612
reason="truncate not supported upstream",
613613
)
614614
def test_insert_overwrite_from_list(con, employee_data_1_temp_table):
@@ -725,7 +725,7 @@ def test_list_database_contents(con):
725725
@pytest.mark.notyet(["databricks"], raises=DatabricksServerOperationError)
726726
@pytest.mark.notyet(["bigquery"], raises=com.UnsupportedBackendType)
727727
@pytest.mark.notyet(
728-
["postgres"], raises=PsycoPgUndefinedObject, reason="no unsigned int types"
728+
["postgres"], raises=PsycoPg2UndefinedObject, reason="no unsigned int types"
729729
)
730730
@pytest.mark.notyet(
731731
["oracle"], raises=OracleDatabaseError, reason="no unsigned int types"
@@ -737,7 +737,7 @@ def test_list_database_contents(con):
737737
@pytest.mark.notyet(["impala"], raises=ImpalaHiveServer2Error)
738738
@pytest.mark.notyet(
739739
["risingwave"],
740-
raises=PsycoPgInternalError,
740+
raises=PsycoPg2InternalError,
741741
reason="unsigned integers are not supported",
742742
)
743743
@pytest.mark.notimpl(

ibis/backends/tests/test_generic.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
MySQLProgrammingError,
2525
OracleDatabaseError,
2626
PolarsInvalidOperationError,
27-
PsycoPgInternalError,
28-
PsycoPgSyntaxError,
27+
PsycoPg2InternalError,
28+
PsycoPg2SyntaxError,
2929
Py4JJavaError,
3030
PyAthenaDatabaseError,
3131
PyAthenaOperationalError,
@@ -1132,7 +1132,7 @@ def test_typeof(con):
11321132
@pytest.mark.notyet(["exasol"], raises=ExaQueryError, reason="not supported by exasol")
11331133
@pytest.mark.notyet(
11341134
["risingwave"],
1135-
raises=PsycoPgInternalError,
1135+
raises=PsycoPg2InternalError,
11361136
reason="https://github.com/risingwavelabs/risingwave/issues/1343",
11371137
)
11381138
@pytest.mark.notyet(
@@ -1735,8 +1735,8 @@ def hash_256(col):
17351735
pytest.mark.notimpl(["flink"], raises=Py4JJavaError),
17361736
pytest.mark.notimpl(["druid"], raises=PyDruidProgrammingError),
17371737
pytest.mark.notimpl(["oracle"], raises=OracleDatabaseError),
1738-
pytest.mark.notimpl(["postgres"], raises=PsycoPgSyntaxError),
1739-
pytest.mark.notimpl(["risingwave"], raises=PsycoPgInternalError),
1738+
pytest.mark.notimpl(["postgres"], raises=PsycoPg2SyntaxError),
1739+
pytest.mark.notimpl(["risingwave"], raises=PsycoPg2InternalError),
17401740
pytest.mark.notimpl(["snowflake"], raises=AssertionError),
17411741
pytest.mark.never(
17421742
["datafusion", "exasol", "impala", "mssql", "mysql", "sqlite"],
@@ -2073,7 +2073,7 @@ def test_static_table_slice(backend, slc, expected_count_fn):
20732073
)
20742074
@pytest.mark.notimpl(
20752075
["risingwave"],
2076-
raises=PsycoPgInternalError,
2076+
raises=PsycoPg2InternalError,
20772077
reason="risingwave doesn't support limit/offset",
20782078
)
20792079
@pytest.mark.notyet(
@@ -2174,7 +2174,7 @@ def test_dynamic_table_slice(backend, slc, expected_count_fn):
21742174
)
21752175
@pytest.mark.notimpl(
21762176
["risingwave"],
2177-
raises=PsycoPgInternalError,
2177+
raises=PsycoPg2InternalError,
21782178
reason="risingwave doesn't support limit/offset",
21792179
)
21802180
def test_dynamic_table_slice_with_computed_offset(backend):

0 commit comments

Comments
 (0)