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


##########
python/pyarrow/pandas_compat.py:
##########
@@ -181,19 +181,18 @@ def get_column_metadata(column, name, arrow_type, 
field_name):
             )
         )
 
-    assert field_name is None or isinstance(field_name, str), \
-        str(type(field_name))
+    assert isinstance(field_name, str), str(type(field_name))
     return {
         'name': name,
-        'field_name': 'None' if field_name is None else field_name,
+        'field_name': field_name,
         'pandas_type': logical_type,
         'numpy_type': string_dtype,
         'metadata': extra_metadata,
     }
 
 
-def construct_metadata(columns_to_convert, df, column_names, index_levels,
-                       index_descriptors, preserve_index, types):
+def construct_metadata(columns_to_convert, df, column_names, 
column_field_names,
+                       index_levels, index_descriptors, preserve_index, types):

Review Comment:
   And good that you ask it, because based on a quick github search it seems 
that cudf _is_ using this .. 
(https://github.com/search?q=repo%3Arapidsai%2Fcudf%20construct_metadata&type=code,
 eg 
https://github.com/rapidsai/cudf/blob/0c5bd6627159fe44a49e56020f0c0842696bc397/python/cudf/cudf/core/dataframe.py#L5772).
 
   (and also legate 
(https://github.com/nv-legate/legate.pandas/blob/7a97b455999e49c328c1873e49fb65d2eade7f2a/legate/pandas/core/table.py#L1230),
 but that is not an active project)
   
   While I don't think we should keep to much compatibility guarantees here, 
let me just make it backwards compatible by making it an optional keyword (and 
later I think we should consider deprecating this and making it private) 



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