-
Notifications
You must be signed in to change notification settings - Fork 4k
Open
Description
Describe the bug, including details regarding any error messages, version, and platform.
Example test case to reproduce bug:
import pyarrow
my_schema = pyarrow.schema(
[pyarrow.field("n_legs", pyarrow.int64()), pyarrow.field("animals", pyarrow.string())],
metadata={"source": "zoo"}, # We want to preserve this
)
table = pyarrow.Table.from_arrays([[2, 4], ["Flamingo", "Horse"]], schema=my_schema)
assert table.schema.metadata == {b"source": b"zoo"}
new_table = table.rename_columns(["n", "name"])
assert new_table.schema.metadata == {b"source": b"zoo"} # oh no - conservation efforts gone awry!The last assert fails due to metadata being None.
versions tested:
- 21.0.0
- 22.0.0
platforms tested:
- windows
most likely need to copy the metadata here:
Line 369 in 44f82a4
| return Table::Make(::arrow::schema(std::move(fields)), std::move(columns), num_rows()); |
Component(s)
Python, C++