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


##########
python/pyarrow/feather.py:
##########
@@ -151,7 +151,17 @@ def write_feather(df, dest, compression=None, 
compression_level=None,
             df = df.to_dense()
 
     if _pandas_api.is_data_frame(df):
-        table = Table.from_pandas(df, preserve_index=False)
+        """
+        Feather v1 creates a new column in the resulting Table for 
+        storing index.
+        """
+        if version == 1:
+            preserve_index = False
+
+        else:
+            preserve_index = True

Review Comment:
   I think you can use `preserve_index=None` here. In practice, that almost 
means the same, except that for pandas' default RangeIndex it stores this 
information more efficiently (as metadata instead of an actual column). 
   
   See https://arrow.apache.org/docs/python/pandas.html#handling-pandas-indexes 
/ 
https://arrow.apache.org/docs/python/generated/pyarrow.Table.html#pyarrow.Table.from_pandas



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