-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: read_excel not working when filters are active and selected in worksheet #51557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi, thanks for your report. Is this an intended feature from openpyxl? If no, you should probably open an issue there |
Hi! https://foss.heptapod.net/openpyxl/openpyxl/-/commit/3af0b77f8a56820961e08e2e751026c984907a1d |
I am not able to reproduce this, maybe I'm misunderstanding the issue. Here is my Excel file with row 3 filtered: Then reading the file with openpyxl gives me all the data even though the filter is activated.
|
Okay as you were not able to reproduce i checked and it only occurs with files that have an active filter and some values of rows are empty test file i created on which i get the error: |
Thanks for the example workbook. Running this, the ValueError I get is raised from |
Closing |
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
Hi!
Since the update of openpyxl (31 january 2022) read_excel is no longer working properly to read excel files that have an active filter on them. With active filter i mean the filter function of excel where there is a selection active (for example one value in a column is excluded). Is there a method or way we can/argument to add in order to remove the auto filter from the file so that the file can be read again?
file from the pandas module where the error is found: site-packages/pandas/io/excel/_openpyxl.py
error: Value must be either numerical or a string containing a wildcard
current version of pandas: 1.5.3
Version in which it worked from openpyxl 3.0.10
No longer working in latest two versions of openpyxl
Thank you in advance!
Expected Behavior
Read the file without the active filters so that all data is included
Installed Versions
pandas : 1.5.3
numpy : 1.20.3
pytz : 2021.3
dateutil : 2.8.2
setuptools : 58.0.4
pip : 21.2.4
Cython : 0.29.24
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.9.2
html5lib : None
pymysql : None
psycopg2 : 2.9.3
jinja2 : 2.11.3
IPython : 7.32.0
pandas_datareader: None
bs4 : None
bottleneck : None
brotli : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : 3.4.3
numba : None
numexpr : None
odfpy : None
openpyxl : 3.1.1
pandas_gbq : None
pyarrow : 7.0.0
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : 1.7.1
snappy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : 2.0.1
xlwt : None
zstandard : None
tzdata : None
The text was updated successfully, but these errors were encountered: