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/04/08 09:36:23 UTC

[GitHub] [arrow] Salonijain27 commented on a diff in pull request #12821: ARROW-7914: [Python] Allow pandas datetime as index for feather

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


##########
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:
   Thank you, I updated the code to set `preserve_index` to `None` if `version==2` or if `version==1` and df index type is `RangeIndex`
   



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