DominikHallab opened a new issue, #48024:
URL: https://github.com/apache/arrow/issues/48024
### Describe the bug, including details regarding any error messages,
version, and platform.
Example test case to reproduce bug:
```py
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!
```
most likely need to copy the metadata here:
https://github.com/apache/arrow/blob/44f82a402422237adc32551a26ea20ab45366282/cpp/src/arrow/table.cc#L369
### Component(s)
Python, C++
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]