Skip to content

BLD: bump xlrd min version to 1.2.0 #35728

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

Merged
merged 1 commit into from
Aug 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/deps/azure-37-locale_slow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies:
- pytz=2017.3
- scipy
- sqlalchemy=1.2.8
- xlrd=1.1.0
- xlrd=1.2.0
- xlsxwriter=1.0.2
- xlwt=1.3.0
- html5lib=1.0.1
2 changes: 1 addition & 1 deletion ci/deps/azure-37-minimum_versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies:
- pytz=2017.3
- pyarrow=0.15
- scipy=1.2
- xlrd=1.1.0
- xlrd=1.2.0
- xlsxwriter=1.0.2
- xlwt=1.3.0
- html5lib=1.0.1
2 changes: 1 addition & 1 deletion doc/source/getting_started/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ s3fs 0.4.0 Amazon S3 access
tabulate 0.8.3 Printing in Markdown-friendly format (see `tabulate`_)
xarray 0.12.0 pandas-like API for N-dimensional data
xclip Clipboard I/O on linux
xlrd 1.1.0 Excel reading
xlrd 1.2.0 Excel reading
xlwt 1.3.0 Excel writing
xsel Clipboard I/O on linux
zlib Compression for HDF5
Expand Down
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v1.2.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Optional libraries below the lowest tested version may still work, but are not c
+-----------------+-----------------+---------+
| xarray | 0.12.0 | X |
+-----------------+-----------------+---------+
| xlrd | 1.1.0 | |
| xlrd | 1.2.0 | X |
+-----------------+-----------------+---------+
| xlsxwriter | 1.0.2 | X |
+-----------------+-----------------+---------+
Expand Down
2 changes: 1 addition & 1 deletion pandas/compat/_optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"tables": "3.4.3",
"tabulate": "0.8.3",
"xarray": "0.8.2",
"xlrd": "1.1.0",
"xlrd": "1.2.0",
"xlwt": "1.2.0",
"xlsxwriter": "0.9.8",
"numba": "0.46.0",
Expand Down
43 changes: 11 additions & 32 deletions pandas/tests/io/excel/test_readers.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import contextlib
from datetime import datetime, time
from functools import partial
import os
from urllib.error import URLError
import warnings

import numpy as np
import pytest
Expand All @@ -14,22 +12,6 @@
from pandas import DataFrame, Index, MultiIndex, Series
import pandas._testing as tm


@contextlib.contextmanager
def ignore_xlrd_time_clock_warning():
"""
Context manager to ignore warnings raised by the xlrd library,
regarding the deprecation of `time.clock` in Python 3.7.
"""
with warnings.catch_warnings():
warnings.filterwarnings(
action="ignore",
message="time.clock has been deprecated",
category=DeprecationWarning,
)
yield


read_ext_params = [".xls", ".xlsx", ".xlsm", ".xlsb", ".ods"]
engine_params = [
# Add any engines to test here
Expand Down Expand Up @@ -134,21 +116,19 @@ def test_usecols_int(self, read_ext, df_ref):
# usecols as int
msg = "Passing an integer for `usecols`"
with pytest.raises(ValueError, match=msg):
with ignore_xlrd_time_clock_warning():
pd.read_excel(
"test1" + read_ext, sheet_name="Sheet1", index_col=0, usecols=3
)
pd.read_excel(
"test1" + read_ext, sheet_name="Sheet1", index_col=0, usecols=3
)

# usecols as int
with pytest.raises(ValueError, match=msg):
with ignore_xlrd_time_clock_warning():
pd.read_excel(
"test1" + read_ext,
sheet_name="Sheet2",
skiprows=[1],
index_col=0,
usecols=3,
)
pd.read_excel(
"test1" + read_ext,
sheet_name="Sheet2",
skiprows=[1],
index_col=0,
usecols=3,
)

def test_usecols_list(self, read_ext, df_ref):
if pd.read_excel.keywords["engine"] == "pyxlsb":
Expand Down Expand Up @@ -597,8 +577,7 @@ def test_sheet_name(self, read_ext, df_ref):
df1 = pd.read_excel(
filename + read_ext, sheet_name=sheet_name, index_col=0
) # doc
with ignore_xlrd_time_clock_warning():
df2 = pd.read_excel(filename + read_ext, index_col=0, sheet_name=sheet_name)
df2 = pd.read_excel(filename + read_ext, index_col=0, sheet_name=sheet_name)

tm.assert_frame_equal(df1, df_ref, check_names=False)
tm.assert_frame_equal(df2, df_ref, check_names=False)
Expand Down