Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoly Myachev <[email protected]>
  • Loading branch information
anmyachev committed Aug 10, 2023
1 parent b43de91 commit 1338067
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions modin/core/io/text/excel_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"""Module houses `ExcelDispatcher` class, that is used for reading excel files."""

import os
from io import BytesIO, StringIO
from io import BytesIO

import pandas
import re
Expand Down Expand Up @@ -63,15 +63,15 @@ def _read(cls, io, **kwargs):
io = BytesIO(io)

# isinstance(ExcelFile, os.PathLike) == True
if not isinstance(io, (str, os.PathLike, BytesIO, StringIO)) or isinstance(
if not isinstance(io, (str, os.PathLike, BytesIO)) or isinstance(
io, (ExcelFile, pandas.ExcelFile)
):
if isinstance(io, ExcelFile):
io._set_pandas_mode()
return cls.single_worker_read(
io,
reason="Modin only implements parallel `read_excel` the following types of `io`: "
+ "str, os.PathLike, io.BytesIO, io.StringIO.",
+ "str, os.PathLike, io.BytesIO.",
**kwargs
)

Expand Down
6 changes: 3 additions & 3 deletions modin/pandas/test/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -2102,7 +2102,7 @@ def test_ExcelFile_bytes(self, make_excel_file):
df_equals(modin_excel_file.parse(), pandas_excel_file.parse())
assert isinstance(modin_excel_file, pd.ExcelFile)

def test_read_excel_from_ExcelFile(self, make_excel_file):
def test_read_excel_ExcelFile(self, make_excel_file):
unique_filename = make_excel_file()
with open(unique_filename, mode="rb") as f:
content = f.read()
Expand All @@ -2113,7 +2113,7 @@ def test_read_excel_from_ExcelFile(self, make_excel_file):
df_equals(pd.read_excel(modin_excel_file), pandas.read_excel(pandas_excel_file))

@pytest.mark.parametrize("use_bytes_io", [False, True])
def test_read_excel_from_bytes(self, use_bytes_io, make_excel_file):
def test_read_excel_bytes(self, use_bytes_io, make_excel_file):
unique_filename = make_excel_file()
with open(unique_filename, mode="rb") as f:
io_bytes = f.read()
Expand All @@ -2127,7 +2127,7 @@ def test_read_excel_from_bytes(self, use_bytes_io, make_excel_file):
io=io_bytes,
)

def test_read_excel_from_file_handle(self, make_excel_file):
def test_read_excel_file_handle(self, make_excel_file):
unique_filename = make_excel_file()
with open(unique_filename, mode="rb") as f:
eval_io(
Expand Down

0 comments on commit 1338067

Please sign in to comment.