Field metadata is not read when using @apache-arrow/ts@0.13.0. Example below also uses pyarrow==0.13.0
Steps to reproduce:
Adding metadata:
importpyarrowaspaimportpandasaspdsource="sample.csv"output="sample.arrow"df=pd.read_csv(source)
table=pa.Table.from_pandas(df)
schema=pa.schema([
column.field.add_metadata({"foo": "bar"}))
forcolumnintable.columns
])
writer=pa.RecordBatchFileWriter(output, schema)
writer.write(table)
writer.close()Reading field metadata using pyarrow:
source="sample.arrow"field="foo"reader=pa.RecordBatchFileReader(source)
reader.schema.field_by_name(field).metadata# Correctly shows `{"foo": "bar"}`Reading field metadata using @apache-arrow/ts:
import{Table,Field,Type}from"@apache-arrow/ts";consturl="https://example.com/sample.arrow";constbuf=awaitfetch(url).then(res=>res.arrayBuffer());consttable=Table.from([newUint8Array(buf)]);for(letfieldoftable.schema.fields){field.metadata;// Incorrectly shows an empty map}
Field metadata is not read when using
@apache-arrow/ts@0.13.0. Example below also usespyarrow==0.13.0Steps to reproduce:
Adding metadata:
Reading field metadata using
pyarrow:Reading field metadata using
@apache-arrow/ts: