@@ -243,11 +243,12 @@ class aDataset(af.Dataset):
243
243
data = aDataset (v1 = [True ], v2 = [1 / 2 ], v3 = [3 ])
244
244
test_file_arrow = Path ("test_arrow.parquet" )
245
245
test_file_duckdb = Path ("test_duckdb.parquet" )
246
+ test_file_duckdb_polars = Path ("test_duckdb_polars.parquet" )
246
247
data .to_parquet (test_file_arrow , engine = "arrow" )
247
248
data .to_parquet (test_file_duckdb , engine = "duckdb" )
249
+ data .to_parquet (test_file_duckdb_polars , engine = "duckdb" , df = data .pl )
248
250
class KeyValueMetadata (af .Dataset ):
249
251
"""Stores results of reading Parquet metadata."""
250
- file_name = af .VectorObject ()
251
252
key = af .VectorObject ()
252
253
value = af .VectorObject ()
253
254
test_file_metadata_arrow = KeyValueMetadata .from_sql (
@@ -259,11 +260,24 @@ class KeyValueMetadata(af.Dataset):
259
260
FROM parquet_kv_metadata('{ test_file_arrow } ')
260
261
WHERE DECODE(key) != 'ARROW:schema'
261
262
""" ,
263
+ method = "pandas" ,
264
+ field_names = "strict"
265
+ )
266
+ test_file_metadata_duckdb = KeyValueMetadata .from_sql (
267
+ f"""
268
+ SELECT
269
+ DECODE(key) AS key,
270
+ DECODE(value) AS value,
271
+ FROM parquet_kv_metadata('{ test_file_duckdb_polars } ')
272
+ WHERE DECODE(key) != 'ARROW:schema'
273
+ """ ,
262
274
method = "polars" ,
263
275
field_names = "strict"
264
276
)
277
+ assert test_file_metadata_arrow == test_file_metadata_duckdb
265
278
test_file_arrow .unlink ()
266
279
test_file_duckdb .unlink ()
280
+ test_file_duckdb_polars .unlink ()
267
281
assert all (
268
282
value in test_file_metadata_arrow .value .values
269
283
for value in [
0 commit comments