Skip to content

Commit 7452573

Browse files
committed
Expect deprecation warning
1 parent fa38f4a commit 7452573

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

python/tests/test_sql.py

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,24 @@ def test_register_parquet_partitioned(ctx, tmp_path, path_to_str, legacy_data_ty
181181

182182
partition_data_type = "string" if legacy_data_type else pa.string()
183183

184-
ctx.register_parquet(
185-
"datapp",
186-
dir_root,
187-
table_partition_cols=[("grp", partition_data_type)],
188-
parquet_pruning=True,
189-
file_extension=".parquet",
190-
)
184+
if legacy_data_type:
185+
with pytest.warns(DeprecationWarning):
186+
ctx.register_parquet(
187+
"datapp",
188+
dir_root,
189+
table_partition_cols=[("grp", partition_data_type)],
190+
parquet_pruning=True,
191+
file_extension=".parquet",
192+
)
193+
else:
194+
ctx.register_parquet(
195+
"datapp",
196+
dir_root,
197+
table_partition_cols=[("grp", partition_data_type)],
198+
parquet_pruning=True,
199+
file_extension=".parquet",
200+
)
201+
191202
assert ctx.catalog().schema().names() == {"datapp"}
192203

193204
result = ctx.sql("SELECT grp, COUNT(*) AS cnt FROM datapp GROUP BY grp").collect()

0 commit comments

Comments
 (0)