Sagi
12/31/2024, 9:53 AMFixedShapeTensor columns, but now when I check the schema, it looks like daft doesn't recognize its native datatype extensions anymore:
Extension[arrow.fixed_shape_tensor; FixedSizeList[UInt8; 3174400]]
Will this affect the performance or correctness of the column parsing? Is it related to the versions of daft/pyarrow/python I used to write the dataset?Kevin Wang
01/06/2025, 7:56 PMKevin Wang
01/06/2025, 7:57 PMSagi
01/12/2025, 5:09 PMwrite_parquet method. I assumed that all the needed information is kept in the arrow extension dtypes.
If I read with daft a file that was written with pyarrow, the schema can't be inferred:
import daft
import tempfile
import numpy as np
import pyarrow.parquet as pq
df = daft.from_pydict({"tensor": [np.ones((2,2), dtype=np.uint8)]})
with tempfile.NamedTemporaryFile(suffix=".parquet") as f:
pq.write_table(df.to_arrow(), f.name)
df = daft.read_parquet(f.name)
print(df.schema())
df = daft.from_arrow(pq.read_table(f.name))
print(df.schema())`
╭─────────────┬────────────────────────────────────────────────╮
│ Column Name ┆ Type │
╞═════════════╪════════════════════════════════════════════════╡
│ tensor ┆ Struct[data: List[UInt8], shape: List[UInt64]] │
╰─────────────┴────────────────────────────────────────────────╯
╭─────────────┬───────────────╮
│ Column Name ┆ Type │
╞═════════════╪═══════════════╡
│ tensor ┆ Tensor(UInt8) │Kevin Wang
01/13/2025, 7:07 PMdf.write_parquet(...)) it seems to infer the schema just fine with daft.read_parquet. I'll take a look at why there is a discrepancy. Thanks for the info!