You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/06/22 22:33:53 UTC

[GitHub] [arrow] martin-liu commented on a diff in pull request #13402: MINOR: [Python] Fix pandas conversion failure when using non-str index name

martin-liu commented on code in PR #13402:
URL: https://github.com/apache/arrow/pull/13402#discussion_r904343035


##########
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:
   Good point! I tested that `_check_pandas_roundtrip` will fail



-- 
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