AlenkaF commented on code in PR #14804:
URL: https://github.com/apache/arrow/pull/14804#discussion_r1068519230
##########
python/pyarrow/tests/interchange/test_conversion.py:
##########
@@ -192,6 +187,34 @@ def test_pandas_roundtrip(uint, int, float, np_float):
assert table_protocol.column_names() == result_protocol.column_names()
[email protected]
+def test_roundtrip_pandas_string():
+ # See https://github.com/pandas-dev/pandas/issues/50554
+ if Version(pd.__version__) < Version("1.6"):
+ pytest.skip(" Column.size() called as a method in pandas 2.0.0")
+
+ # large string is not supported by pandas implementation
+ table = pa.table({"a": pa.array(["a", "", "c"])})
+
+ from pandas.api.interchange import (
+ from_dataframe as pandas_from_dataframe
+ )
+ pandas_df = pandas_from_dataframe(table)
+ result = pi.from_dataframe(pandas_df)
+
Review Comment:
Due to pandas defining `int64` offset for what is in our case normal string,
not large, the dtype that is at the end of the roundtrip becomes
`large_string`. Due to that, the assertion is done with pylist for the vakues
and separate for dtype (first inormal string, then large string).
--
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]