jorisvandenbossche commented on a change in pull request #12189:
URL: https://github.com/apache/arrow/pull/12189#discussion_r787974686
##########
File path: python/pyarrow/tests/test_table.py
##########
@@ -348,10 +349,26 @@ def test_table_roundtrip_to_pandas_empty_dataframe():
table = pa.table(data)
result = table.to_pandas()
+ # TODO the conversion results in a table with 0 rows if there is no index
+ # column
Review comment:
Will try to clarify the comment. The DataFrame has an index, but if it's
a default 0,1,2,..n range index, we don't actually create a column on the arrow
side, but only store that information in the metadata. And the way the current
pandas->arrow conversion is implemented, is that we get a list of arrays from
the dataframe, and then basically do `Table.from_arrays`. But so in that
implementation, if there are no arrays, `Table.from_arrays` can't return a
table with a certain length ( so `num_rows` > 0 while `num_cols == 0`)
--
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]