Skip to content
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

bump calamine to 0.1.1, update tests (472 passed, 75 xfailed), update… #8

Merged
merged 1 commit into from
May 1, 2023
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/actions-311.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ dependencies:
- zstandard>=0.15.2

- pip:
- python-calamine>=0.1.0
- python-calamine>=0.1.1
- tzdata>=2022.1
2 changes: 1 addition & 1 deletion ci/deps/actions-38-minimum_versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ dependencies:

- pip:
- pyqt5==5.15.1
- python-calamine==0.1.0
- python-calamine==0.1.1
- tzdata==2022.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 @@ -345,7 +345,7 @@ xlrd 2.0.1 excel Reading Excel
xlsxwriter 1.4.3 excel Writing Excel
openpyxl 3.0.7 excel Reading / writing for xlsx files
pyxlsb 1.0.8 excel Reading for xlsb files
python-calamine 0.1.0 excel Reading for xls/xlsx/xlsb/ods files
python-calamine 0.1.1 excel Reading for xls/xlsx/xlsb/ods files
========================= ================== =============== =============================================================

HTML
Expand Down
3 changes: 2 additions & 1 deletion doc/source/user_guide/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3421,7 +3421,8 @@ The :func:`~pandas.read_excel` method can read Excel 2007+ (``.xlsx``) files
using the ``openpyxl`` Python module. Excel 2003 (``.xls``) files
can be read using ``xlrd``. Binary Excel (``.xlsb``)
files can be read using ``pyxlsb``. Also, all this formats can be read using ``python-calamine``,
but this library has sime limitation, for example, can't detect date in most formats.
but this library has some limitation and different behavior from other libraries,
for example, can't detect date in some formats (xls and xlsb).
The :meth:`~DataFrame.to_excel` instance method is used for
saving a ``DataFrame`` to Excel. Generally the semantics are
similar to working with :ref:`csv<io.read_csv_table>` data.
Expand Down
2 changes: 1 addition & 1 deletion pandas/compat/_optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"pyarrow": "7.0.0",
"pyreadstat": "1.1.2",
"pytest": "7.0.0",
"python-calamine": "0.1.0",
"python-calamine": "0.1.1",
"pyxlsb": "1.0.8",
"s3fs": "2021.08.0",
"scipy": "1.7.1",
Expand Down
87 changes: 41 additions & 46 deletions pandas/tests/io/excel/test_readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ def test_usecols_list(self, request, engine, read_ext, df_ref):
reason="Sheets containing datetimes not supported by pyxlsb"
)
)
if engine == "calamine" and read_ext in {".xls", ".xlsb", ".ods"}:
if engine == "calamine" and read_ext in {".xls", ".xlsb"}:
request.node.add_marker(
pytest.mark.xfail(
reason="Calamine support parsing datetime only in xlsx"
reason="Calamine support parsing datetime only in xlsx/ods"
)
)

Expand All @@ -204,10 +204,10 @@ def test_usecols_str(self, request, engine, read_ext, df_ref):
reason="Sheets containing datetimes not supported by pyxlsb"
)
)
if engine == "calamine" and read_ext in {".xls", ".xlsb", ".ods"}:
if engine == "calamine" and read_ext in {".xls", ".xlsb"}:
request.node.add_marker(
pytest.mark.xfail(
reason="Calamine support parsing datetime only in xlsx"
reason="Calamine support parsing datetime only in xlsx/ods"
)
)

Expand Down Expand Up @@ -268,10 +268,10 @@ def test_usecols_diff_positional_int_columns_order(
reason="Sheets containing datetimes not supported by pyxlsb"
)
)
if engine == "calamine" and read_ext in {".xls", ".xlsb", ".ods"}:
if engine == "calamine" and read_ext in {".xls", ".xlsb"}:
request.node.add_marker(
pytest.mark.xfail(
reason="Calamine support parsing datetime only in xlsx"
reason="Calamine support parsing datetime only in xlsx/ods"
)
)

Expand All @@ -296,10 +296,10 @@ def test_read_excel_without_slicing(self, request, engine, read_ext, df_ref):
reason="Sheets containing datetimes not supported by pyxlsb"
)
)
if engine == "calamine" and read_ext in {".xls", ".xlsb", ".ods"}:
if engine == "calamine" and read_ext in {".xls", ".xlsb"}:
request.node.add_marker(
pytest.mark.xfail(
reason="Calamine support parsing datetime only in xlsx"
reason="Calamine support parsing datetime only in xlsx/ods"
)
)

Expand All @@ -314,10 +314,10 @@ def test_usecols_excel_range_str(self, request, engine, read_ext, df_ref):
reason="Sheets containing datetimes not supported by pyxlsb"
)
)
if engine == "calamine" and read_ext in {".xls", ".xlsb", ".ods"}:
if engine == "calamine" and read_ext in {".xls", ".xlsb"}:
request.node.add_marker(
pytest.mark.xfail(
reason="Calamine support parsing datetime only in xlsx"
reason="Calamine support parsing datetime only in xlsx/ods"
)
)

Expand Down Expand Up @@ -400,11 +400,9 @@ def test_excel_cell_error_na(self, request, engine, read_ext):
reason="Sheets containing datetimes not supported by pyxlsb"
)
)
if engine == "calamine" and read_ext in {".ods"}:
if engine == "calamine" and read_ext == ".ods":
request.node.add_marker(
pytest.mark.xfail(
reason="Calamine support parsing datetime only in xlsx"
)
pytest.mark.xfail(reason="Calamine returns 0 instead of NaN in ods")
)

parsed = pd.read_excel("test3" + read_ext, sheet_name="Sheet1")
Expand All @@ -418,10 +416,10 @@ def test_excel_table(self, request, engine, read_ext, df_ref):
reason="Sheets containing datetimes not supported by pyxlsb"
)
)
if engine == "calamine" and read_ext in {".xls", ".xlsb", ".ods"}:
if engine == "calamine" and read_ext in {".xls", ".xlsb"}:
request.node.add_marker(
pytest.mark.xfail(
reason="Calamine support parsing datetime only in xlsx"
reason="Calamine support parsing datetime only in xlsx/ods"
)
)

Expand All @@ -445,15 +443,15 @@ def test_reader_special_dtypes(self, request, engine, read_ext):
reason="Sheets containing datetimes not supported by pyxlsb"
)
)
if engine == "calamine" and read_ext in {".xls", ".xlsb", ".ods"}:
if engine == "calamine" and read_ext in {".xls", ".xlsb"}:
request.node.add_marker(
pytest.mark.xfail(
reason="Calamine support parsing datetime only in xlsx"
reason="Calamine support parsing datetime only in xlsx/ods"
)
)
if engine == "calamine":
if engine == "calamine" and read_ext != ".ods":
request.node.add_marker(
pytest.mark.xfail(reason="Calamine can't parse this datetime format")
pytest.mark.xfail(reason="Maybe not supported by calamine")
)

expected = DataFrame.from_dict(
Expand Down Expand Up @@ -715,13 +713,6 @@ def test_dtype_mangle_dup_cols(self, read_ext, dtypes, exp_value):

def test_reader_spaces(self, request, engine, read_ext):
# see gh-32207

# https://github.com/tafia/calamine/pull/289
if engine == "calamine" and read_ext == ".ods":
request.node.add_marker(
pytest.mark.xfail(reason="Calamine doesn't respect spaces in ods")
)

basename = "test_spaces"

actual = pd.read_excel(basename + read_ext)
Expand Down Expand Up @@ -826,7 +817,7 @@ def test_date_conversion_overflow(self, request, engine, read_ext):
columns=["DateColWithBigInt", "StringCol"],
)

if engine == "calamine":
if engine == "calamine" and read_ext != ".ods":
request.node.add_marker(
pytest.mark.xfail(reason="Maybe not supported by calamine")
)
Expand All @@ -852,10 +843,10 @@ def test_sheet_name(self, request, read_ext, engine, df_ref):
reason="Sheets containing datetimes not supported by pyxlsb"
)
)
if engine == "calamine" and read_ext in {".xls", ".xlsb", ".ods"}:
if engine == "calamine" and read_ext in {".xls", ".xlsb"}:
request.node.add_marker(
pytest.mark.xfail(
reason="Calamine support parsing datetime only in xlsx"
reason="Calamine support parsing datetime only in xlsx/ods"
)
)

Expand Down Expand Up @@ -1027,10 +1018,10 @@ def test_reader_seconds(self, request, engine, read_ext):
reason="Sheets containing datetimes not supported by pyxlsb"
)
)
if engine == "calamine" and read_ext in {".xls", ".xlsb", ".ods"}:
if engine == "calamine" and read_ext in {".xls", ".xlsb"}:
request.node.add_marker(
pytest.mark.xfail(
reason="Calamine support parsing datetime only in xlsx"
reason="Calamine support parsing datetime only in xlsx/ods"
)
)
if engine == "calamine":
Expand Down Expand Up @@ -1073,12 +1064,16 @@ def test_read_excel_multiindex(self, request, engine, read_ext):
reason="Sheets containing datetimes not supported by pyxlsb"
)
)
if engine == "calamine" and read_ext in {".xls", ".xlsb", ".ods"}:
if engine == "calamine" and read_ext in {".xls", ".xlsb"}:
request.node.add_marker(
pytest.mark.xfail(
reason="Calamine support parsing datetime only in xlsx"
reason="Calamine support parsing datetime only in xlsx/ods"
)
)
if engine == "calamine" and read_ext == ".ods":
request.node.add_marker(
pytest.mark.xfail(reason="Last test fails in calamine")
)

mi = MultiIndex.from_product([["foo", "bar"], ["a", "b"]])
mi_file = "testmultiindex" + read_ext
Expand Down Expand Up @@ -1175,10 +1170,10 @@ def test_read_excel_multiindex_blank_after_name(
f"not supported by {engine} (GH4679)"
)
)
if engine == "calamine" and read_ext in {".xls", ".xlsb", ".ods"}:
if engine == "calamine" and read_ext in {".xls", ".xlsb"}:
request.node.add_marker(
pytest.mark.xfail(
reason="Calamine support parsing datetime only in xlsx"
reason="Calamine support parsing datetime only in xlsx/ods"
)
)

Expand Down Expand Up @@ -1310,10 +1305,10 @@ def test_read_excel_skiprows(self, request, engine, read_ext):
reason="Sheets containing datetimes not supported by pyxlsb"
)
)
if engine == "calamine" and read_ext in {".xls", ".xlsb", ".ods"}:
if engine == "calamine" and read_ext in {".xls", ".xlsb"}:
request.node.add_marker(
pytest.mark.xfail(
reason="Calamine support parsing datetime only in xlsx"
reason="Calamine support parsing datetime only in xlsx/ods"
)
)

Expand Down Expand Up @@ -1371,10 +1366,10 @@ def test_read_excel_skiprows_callable_not_in(self, request, engine, read_ext):
reason="Sheets containing datetimes not supported by pyxlsb"
)
)
if engine == "calamine" and read_ext in {".xls", ".xlsb", ".ods"}:
if engine == "calamine" and read_ext in {".xls", ".xlsb"}:
request.node.add_marker(
pytest.mark.xfail(
reason="Calamine support parsing datetime only in xlsx"
reason="Calamine support parsing datetime only in xlsx/ods"
)
)

Expand Down Expand Up @@ -1651,10 +1646,10 @@ def test_excel_table_sheet_by_index(self, request, engine, read_ext, df_ref):
reason="Sheets containing datetimes not supported by pyxlsb"
)
)
if engine == "calamine" and read_ext in {".xls", ".xlsb", ".ods"}:
if engine == "calamine" and read_ext in {".xls", ".xlsb"}:
request.node.add_marker(
pytest.mark.xfail(
reason="Calamine support parsing datetime only in xlsx"
reason="Calamine support parsing datetime only in xlsx/ods"
)
)

Expand Down Expand Up @@ -1686,10 +1681,10 @@ def test_sheet_name(self, request, engine, read_ext, df_ref):
reason="Sheets containing datetimes not supported by pyxlsb"
)
)
if engine == "calamine" and read_ext in {".xls", ".xlsb", ".ods"}:
if engine == "calamine" and read_ext in {".xls", ".xlsb"}:
request.node.add_marker(
pytest.mark.xfail(
reason="Calamine support parsing datetime only in xlsx"
reason="Calamine support parsing datetime only in xlsx/ods"
)
)

Expand Down Expand Up @@ -1784,10 +1779,10 @@ def test_read_datetime_multiindex(self, request, engine, read_ext):
reason="Sheets containing datetimes not supported by pyxlsb"
)
)
if engine == "calamine" and read_ext in {".xls", ".xlsb", ".ods"}:
if engine == "calamine" and read_ext in {".xls", ".xlsb"}:
request.node.add_marker(
pytest.mark.xfail(
reason="Calamine support parsing datetime only in xlsx"
reason="Calamine support parsing datetime only in xlsx/ods"
)
)

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ computation = ['scipy>=1.7.1', 'xarray>=0.21.0']
fss = ['fsspec>=2021.07.0']
aws = ['s3fs>=2021.08.0']
gcp = ['gcsfs>=2021.07.0', 'pandas-gbq>=0.15.0']
excel = ['odfpy>=1.4.1', 'openpyxl>=3.0.7', 'python-calamine>=0.1.0', 'pyxlsb>=1.0.8', 'xlrd>=2.0.1', 'xlsxwriter>=1.4.3']
excel = ['odfpy>=1.4.1', 'openpyxl>=3.0.7', 'python-calamine>=0.1.1', 'pyxlsb>=1.0.8', 'xlrd>=2.0.1', 'xlsxwriter>=1.4.3']
parquet = ['pyarrow>=7.0.0']
feather = ['pyarrow>=7.0.0']
hdf5 = [# blosc only available on conda (https://github.com/Blosc/python-blosc/issues/297)
Expand Down Expand Up @@ -104,7 +104,7 @@ all = ['beautifulsoup4>=4.9.3',
'pytest>=7.0.0',
'pytest-xdist>=2.2.0',
'pytest-asyncio>=0.17.0',
'python-calamine>=0.1.0',
'python-calamine>=0.1.1',
'python-snappy>=0.6.0',
'pyxlsb>=1.0.8',
'qtpy>=2.2.0',
Expand Down
2 changes: 1 addition & 1 deletion scripts/tests/data/deps_expected_random.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ dependencies:
- zstandard>=0.15.2

- pip:
- python-calamine>=0.1.0
- python-calamine>=0.1.1
4 changes: 2 additions & 2 deletions scripts/tests/data/deps_minimum.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ computation = ['scipy>=1.7.1', 'xarray>=0.21.0']
fss = ['fsspec>=2021.07.0']
aws = ['s3fs>=2021.08.0']
gcp = ['gcsfs>=2021.07.0', 'pandas-gbq>=0.15.0']
excel = ['odfpy>=1.4.1', 'openpyxl>=3.0.7', 'python-calamine>=0.1.0', 'pyxlsb>=1.0.8', 'xlrd>=2.0.1', 'xlsxwriter>=1.4.3']
excel = ['odfpy>=1.4.1', 'openpyxl>=3.0.7', 'python-calamine>=0.1.1', 'pyxlsb>=1.0.8', 'xlrd>=2.0.1', 'xlsxwriter>=1.4.3']
parquet = ['pyarrow>=7.0.0']
feather = ['pyarrow>=7.0.0']
hdf5 = [# blosc only available on conda (https://github.com/Blosc/python-blosc/issues/297)
Expand Down Expand Up @@ -104,7 +104,7 @@ all = ['beautifulsoup4>=5.9.3',
'pytest>=7.0.0',
'pytest-xdist>=2.2.0',
'pytest-asyncio>=0.17.0',
'python-calamine>=0.1.0',
'python-calamine>=0.1.1',
'python-snappy>=0.6.0',
'pyxlsb>=1.0.8',
'qtpy>=2.2.0',
Expand Down
2 changes: 1 addition & 1 deletion scripts/tests/data/deps_unmodified_random.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ dependencies:
- zstandard>=0.15.2

- pip:
- python-calamine>=0.1.0
- python-calamine>=0.1.1