You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "AlenkaF (via GitHub)" <gi...@apache.org> on 2023/08/16 13:41:50 UTC
[GitHub] [arrow] AlenkaF opened a new issue, #37200: [Python] Converting empty table to batch results in empty list
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: issues-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Python] Converting empty table to batch results in empty list [arrow]
Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF closed issue #37200: [Python] Converting empty table to batch results in empty list
URL: https://github.com/apache/arrow/issues/37200
--
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: issues-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Python] Converting empty table to batch results in empty list [arrow]
Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on issue #37200:
URL: https://github.com/apache/arrow/issues/37200#issuecomment-1748728005
Closing this as there is not a clear idea what to do in cases of empty tables with (can be multiple) empty chunks. Can reopen in future if we see the need to do so.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org