AlenkaF opened a new issue, #37200:
URL: https://github.com/apache/arrow/issues/37200
### Describe the bug, including details regarding any error messages,
version, and platform.
When converting an empty table with a known schema to a record batch, the
information about the schema is lost and the result is an empty list:
```python
>>> my_schema = pa.schema([pa.field('col1', pa.int64())])
>>> df = pa.table([[]], schema=my_schema)
>>> df
pyarrow.Table
col1: int64
----
col1: [[]]
>>> df.to_batches()
[]
```
but in comparison, if we are creating an empty batch with a known schema we
get the following:
```python
>>> batch = pa.record_batch([[]], schema=my_schema)
>>> batch
pyarrow.RecordBatch
col1: int64
----
col1: []
```
and I think this should be same for the case of converting an empty table
with known schema to a record batch.
### Component(s)
Python
--
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]