Skip to content

BUG: pandas 1.3.2 incompatible with fastparquet 0.7.0  #43075

Closed
@mmac-m3a

Description

@mmac-m3a
  • I have checked that this issue has not already been reported.
    I've searched listing of open issues for "parquet" and found no matching entry describing this problem

  • I have confirmed this bug exists on the latest version of pandas.
    Exists in 1.3.2

  • (optional) I have confirmed this bug exists on the master branch of pandas.
    Exists also in the master branch.


Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.

Code Sample, a copy-pastable example

import pandas as pd

df = pd.read_parquet("df.parquet")

This fails with the following stack trace:

In [8]: df = pd.read_parquet("df.parquet")
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-8-3c208bf199a1> in <module>
----> 1 df = pd.read_parquet("df.parquet")

~/.virtual_envs/kapi2/lib/python3.9/site-packages/pandas/io/parquet.py in read_parquet(path, engine, columns, storage_options, use_nullable_dtypes, **kwargs)
    493     impl = get_engine(engine)
    494
--> 495     return impl.read(
    496         path,
    497         columns=columns,

~/.virtual_envs/kapi2/lib/python3.9/site-packages/pandas/io/parquet.py in read(self, path, columns, storage_options, **kwargs)
    342             path = handles.handle
    343
--> 344         parquet_file = self.api.ParquetFile(path, **parquet_kwargs)
    345
    346         result = parquet_file.to_pandas(columns=columns, **kwargs)

TypeError: __init__() got an unexpected keyword argument 'pandas_nulls'

Problem description

AFAICT, the root cause of the problem is the "api" version test in io/parquet.py It needs to test self.api.__version__ > Version("0.7.0"). ParquetFile constructor in fastparquet 0.7.0 does not support pandas_nulls argument. This argument is supported from version 0.7.1.

fastparquet 0.7.1 unfortunately does not build/install on darwin/arm64 (well, at least for me) :-/.

Expected Output

Obviously, the expected behavior is that the DataFrame is read from the file.

Output of pd.show_versions()

INSTALLED VERSIONS ------------------ commit : 5f648bf python : 3.9.5.final.0 python-bits : 64 OS : Darwin OS-release : 20.5.0 Version : Darwin Kernel Version 20.5.0: Sat May 8 05:10:31 PDT 2021; root:xnu-7195.121.3~9/RELEASE_ARM64_T8101 machine : arm64 processor : arm byteorder : little LC_ALL : None LANG : en_US.UTF-8 LOCALE : en_US.UTF-8

pandas : 1.3.2
numpy : 1.21.2
pytz : 2021.1
dateutil : 2.8.2
pip : 21.2.4
setuptools : 56.0.0
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : 7.26.0
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : 2021.07.0
fastparquet : 0.7.0
gcsfs : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None

Metadata

Metadata

Assignees

Labels

BugIO Parquetparquet, featherRegressionFunctionality that used to work in a prior pandas version

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions