lidavidm commented on code in PR #13402:
URL: https://github.com/apache/arrow/pull/13402#discussion_r903652474


##########
python/pyarrow/tests/test_pandas.py:
##########
@@ -149,6 +149,12 @@ def test_non_string_columns(self):
         table = pa.Table.from_pandas(df)
         assert table.field(0).name == '0'
 
+    def test_non_string_columns_with_index(self):
+        df = pd.DataFrame({0: [1, 2, 3], 1: [4, 5, 6]})
+        df = df.set_index(0)
+        table = pa.Table.from_pandas(df)
+        assert table.field(0).name == '1'

Review Comment:
   I suppose, assuming round-tripping the type of the index names works, we 
should also `_check_pandas_roundtrip(df, preserve_index=True)` here



-- 
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-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to