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/10/27 11:14:57 UTC

[GitHub] [arrow] AlenkaF commented on a diff in pull request #14492: ARROW-17192: [Python] Pass **kwargs in read_feather to to_pandas()

AlenkaF commented on code in PR #14492:
URL: https://github.com/apache/arrow/pull/14492#discussion_r1006737517


##########
python/pyarrow/tests/test_feather.py:
##########
@@ -838,3 +838,26 @@ def test_preserve_index_pandas(version):
         expected = df
 
     _check_pandas_roundtrip(df, expected, version=version)
+
+
+@pytest.mark.pandas
+def test_feather_datetime_resolution_arrow_to_pandas(datadir):
+    # ARROW-17192 - ensure timestamp_as_object=True (together with other
+    # **kwargs) can be passed in read_feather to to_pandas.
+
+    # file generated with:
+    #   from datetime import datetime
+    #   df = pd.DataFrame({"date": [
+    #       datetime.fromisoformat("1654-01-01"),
+    #       datetime.fromisoformat("1920-01-01"), ],
+    #   })
+    #   df.to_feather(datadir / "test_resolution.feather")

Review Comment:
   There was a failing test but the issue was in the old version of pandas and `.to_feather()`, not in generating the file in the test (as I was mistakenly presuming, thanks for the help here!).
   
   I will keep it as it was and use `pyarrow.to_feather` instead.



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