jorisvandenbossche commented on code in PR #44195:
URL: https://github.com/apache/arrow/pull/44195#discussion_r1835117672


##########
python/pyarrow/tests/test_pandas.py:
##########
@@ -4523,9 +4550,11 @@ def test_metadata_compat_range_index_pre_0_12():
     gen_name_1 = '__index_level_1__'
 
     # Case 1: named RangeIndex
-    e1 = pd.DataFrame({
-        'a': a_values
-    }, index=pd.RangeIndex(0, 8, step=2, name='qux'))
+    e1 = pd.DataFrame(
+        {'a': a_values},
+        index=pd.RangeIndex(0, 8, step=2, name='qux'),
+        columns=pd.Index(['a'], dtype=object)

Review Comment:
   This test is specifically using old metadata that specifies the dtype of the 
columns is object dtype, and then pyarrow tries to restore it that way.
   
   It's the question if we should do that though .. Because every file written 
from a pandas DataFrame before pandas 3.0 will have that, so maybe we should 
specifically ignore object dtype here if the inferred type is that it contains 
all strings, so users consistently get a columns Index object using `str` dtype



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