Skip to content

[Python] Failing test with pandas master for extension type conversion #24085

Description

@asfimport

The pandas master test build has one failure

_______________test_conversion_extensiontype_to_extensionarray________________monkeypatch = <_pytest.monkeypatch.MonkeyPatchobjectat0x7fcd6c580bd0>
deftest_conversion_extensiontype_to_extensionarray(monkeypatch):
# convertingextensiontypetolinkedpandasExtensionDtype/Arrayimportpandas.core.internalsas_intstorage = pa.array([1, 2, 3, 4], pa.int64())
arr = pa.ExtensionArray.from_storage(MyCustomIntegerType(), storage)
table = pa.table({'a': arr})
ifLooseVersion(pd.__version__) < "0.26.0.dev":
# ensurepandasInt64Dtypehastheprotocolmethod (forolderpandas)
monkeypatch.setattr(
pd.Int64Dtype, '__from_arrow__', _Int64Dtype__from_arrow__,
raising=False)
# extensiontypepointstoInt64Dtype, whichknowshowtocreatea
# pandasExtensionArray
> result = table.to_pandas()
opt/conda/envs/arrow/lib/python3.7/site-packages/pyarrow/tests/test_pandas.py:3560: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pyarrow/ipc.pxi:559: inpyarrow.lib.read_message
???
pyarrow/table.pxi:1369: inpyarrow.lib.Table._to_pandas
???
opt/conda/envs/arrow/lib/python3.7/site-packages/pyarrow/pandas_compat.py:764: intable_to_blockmanagerblocks = _table_to_blocks(options, table, categories, ext_columns_dtypes)
opt/conda/envs/arrow/lib/python3.7/site-packages/pyarrow/pandas_compat.py:1102: in_table_to_blocksforiteminresult]
opt/conda/envs/arrow/lib/python3.7/site-packages/pyarrow/pandas_compat.py:1102: in <listcomp>
foriteminresult]
opt/conda/envs/arrow/lib/python3.7/site-packages/pyarrow/pandas_compat.py:723: in_reconstruct_blockpd_ext_arr = pandas_dtype.__from_arrow__(arr)
opt/conda/envs/arrow/lib/python3.7/site-packages/pandas/core/arrays/integer.py:108: in__from_arrow__array = array.cast(pyarrow_type)
pyarrow/table.pxi:240: inpyarrow.lib.ChunkedArray.cast
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > ???
Epyarrow.lib.ArrowNotImplementedError: Nocastimplementedfromextension<arrow.py_extension_type> toint64

Reporter: Joris Van den Bossche / @jorisvandenbossche
Assignee: Joris Van den Bossche / @jorisvandenbossche

Related issues:

PRs and other links:

Note: This issue was originally created as ARROW-7857. Please see the migration documentation for further details.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions