Skip to content

Commit

Permalink
check metadata only if defined
Browse files Browse the repository at this point in the history
  • Loading branch information
samster25 committed Sep 12, 2023
1 parent f6c5853 commit 6f49ecb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions daft/table/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,6 @@ def read_parquet_into_pyarrow(
multithreaded_io=multithreaded_io,
coerce_int96_timestamp_unit=coerce_int96_timestamp_unit._timeunit,
)
if len(metadata) == 0:
metadata = None
schema = pa.schema(fields, metadata=metadata)
columns = [pa.chunked_array(c) for c in columns] # type: ignore
return pa.table(columns, schema=schema)

Check warning on line 480 in daft/table/table.py

View check run for this annotation

Codecov / codecov/patch

daft/table/table.py#L478-L480

Added lines #L478 - L480 were not covered by tests
2 changes: 1 addition & 1 deletion tests/integration/io/parquet/test_reads_public_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def test_parquet_read_table_into_pyarrow(parquet_file, public_storage_io_config,
)
pa_read = read_parquet_with_pyarrow(url)
assert daft_native_read.schema == pa_read.schema
assert daft_native_read.schema.metadata == pa_read.schema.metadata
assert pa_read.schema.metadata is None or daft_native_read.schema.metadata == pa_read.schema.metadata
pd.testing.assert_frame_equal(daft_native_read.to_pandas(), pa_read.to_pandas())


Expand Down

0 comments on commit 6f49ecb

Please sign in to comment.