raulcd commented on code in PR #46884:
URL: https://github.com/apache/arrow/pull/46884#discussion_r3401574358


##########
python/pyarrow/tests/test_pandas.py:
##########
@@ -421,8 +421,18 @@ def test_index_level_name_bump(self):
         )
         _check_pandas_roundtrip(df, preserve_index=True)
 
-        t = pa.Table.from_pandas(df, preserve_index=True)
-        assert t.schema.names == ['col', '__index_level_0__', 
'__index_level_1__']
+        # Explicit test
+        t = pa.table(df)
+        expected_schema = pa.schema([
+            ("col", pa.int64()),
+            ("__index_level_0__", pa.int64()),
+            ("__index_level_1__", pa.int64())
+        ])
+        assert t.schema.equals(expected_schema)
+
+        df2 = t.to_pandas()
+        assert df2.index.equals(pd.Index([10, 20, 30]))

Review Comment:
   yes, I think I was going for this! Thanks @AlenkaF 



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

Reply via email to