Repository: modin-project/modin

Issue:
read_excel function fail when header is set to None
### System information
- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**: MacOS
- **Modin version** (`modin.__version__`): 0.5.12
- **Python version**: 3.8.13, 3.9.12, 3.10.6
- **Code we can use to reproduce**:

### Describe the problem
`read_excel` function works fine when I didn't include the parameter `header` and set it to `None` with `header=None`.
I have tested it out with an excel that contains a column of only numbers and another excel file with a column that has the 1st row as string and the rest as numbers (the 1st row should also be considered a normal row along with the rest)

### Source code / logs
**Source code**:
Case 1
```
import modin.pandas as pd

data = pd.read_excel('example.xlsx', header=None)
data
```

Case 2
```
import modin.pandas as pd

data = pd.read_excel('example_.xlsx', header=None)
data
```

**Excel file to reproduce**:
[example.xlsx](https://github.com/modin-project/modin/files/9487635/example.xlsx)
[example_2.xlsx](https://github.com/modin-project/modin/files/9487637/example_2.xlsx)


 **Log**:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/shiro/.local/share/virtualenvs/taipy-core-fdyg53sb/lib/python3.9/site-packages/modin/logging/logger_metaclass.py", line 68, in log_wrap
    return method(*args, **kwargs)
  File "/Users/shiro/.local/share/virtualenvs/taipy-core-fdyg53sb/lib/python3.9/site-packages/modin/pandas/dataframe.py", line 215, in __repr__
    result = repr(self._build_repr_df(num_rows, num_cols))
  File "/Users/shiro/.local/share/virtualenvs/taipy-core-fdyg53sb/lib/python3.9/site-packages/modin/logging/logger_metaclass.py", line 68, in log_wrap
    return method(*args, **kwargs)
  File "/Users/shiro/.local/share/virtualenvs/taipy-core-fdyg53sb/lib/python3.9/site-packages/modin/pandas/base.py", line 203, in _build_repr_df
    return self.iloc[indexer]._query_compiler.to_pandas()
  File "/Users/shiro/.local/share/virtualenvs/taipy-core-fdyg53sb/lib/python3.9/site-packages/modin/logging/logger_metaclass.py", line 68, in log_wrap
    return method(*args, **kwargs)
  File "/Users/shiro/.local/share/virtualenvs/taipy-core-fdyg53sb/lib/python3.9/site-packages/modin/core/storage_formats/pandas/query_compiler.py", line 259, in to_pandas
    return self._modin_frame.to_pandas()
  File "/Users/shiro/.local/share/virtualenvs/taipy-core-fdyg53sb/lib/python3.9/site-packages/modin/logging/logger_metaclass.py", line 68, in log_wrap
    return method(*args, **kwargs)
  File "/Users/shiro/.local/share/virtualenvs/taipy-core-fdyg53sb/lib/python3.9/site-packages/modin/core/dataframe/pandas/dataframe/dataframe.py", line 115, in run_f_on_minimally_updated_metadata
    result = f(self, *args, **kwargs)
  File "/Users/shiro/.local/share/virtualenvs/taipy-core-fdyg53sb/lib/python3.9/site-packages/modin/core/dataframe/pandas/dataframe/dataframe.py", line 2840, in to_pandas
    ErrorMessage.catch_bugs_and_request_email(
  File "/Users/shiro/.local/share/virtualenvs/taipy-core-fdyg53sb/lib/python3.9/site-packages/modin/error_message.py", line 70, in catch_bugs_and_request_email
    raise Exception(
Exception: Internal Error. Please visit https://github.com/modin-project/modin/issues to file an issue with the traceback and the command that caused this error. If you can't file a GitHub issue, please email bug_reports@modin.org.
Internal and external indices on axis 1 do not match.
>>> data = pd.read_excel('tests/data_sample/example.xlsx', header=None)
UserWarning: Parallel `read_excel` is a new feature! If you run into any problems, please visit https://github.com/modin-project/modin/issues. If you find a new issue and can't file it on GitHub, please email bug_reports@modin.org.



Discussion:
@toan-quach thank you for reporting this issue. I can reproduce it at version 14edd1ca99e7b9e836285dfac901b2e89ed93644. If I can see a quick fix, I'll make it now.
I can't tell what's going wrong. We'll have to start by understanding how pandas interprets `header=None`.

@toan-quach we will try to fix this soon! Until the bug is fixed, you can work around it by reading the data into a pandas dataframe `pdf` with `pandas.read_excel`, then converting that dataframe to a Modin dataframe with `modin.pandas.DataFrame(pdf)`.

awesome news, thanks for the quick response! Please let me know if I can help in any ways 😄 
Hi @mvashishtha 
May I ask if we have any updates on this topic? Thanks!!! 😄 
@toan-quach unfortunately no one has taken on this issue yet, so I think it hasn't been fixed. You can watch this issue for updates.
@mvashishtha Thanks for the quick response!!! That's unfortunate 😞 

Resolving patch:
diff --git a/modin/core/io/text/excel_dispatcher.py b/modin/core/io/text/excel_dispatcher.py
--- a/modin/core/io/text/excel_dispatcher.py
+++ b/modin/core/io/text/excel_dispatcher.py
@@ -15,7 +15,6 @@
 
 import pandas
 import re
-import sys
 import warnings
 
 from modin.core.io.text.text_file_dispatcher import TextFileDispatcher
@@ -55,12 +54,6 @@ def _read(cls, io, **kwargs):
                 + "use Modin's parallel implementation.",
                 **kwargs
             )
-        if sys.version_info < (3, 7):
-            return cls.single_worker_read(
-                io,
-                reason="Python 3.7 or higher required for parallel `read_excel`.",
-                **kwargs
-            )
 
         from zipfile import ZipFile
         from openpyxl.worksheet.worksheet import Worksheet
@@ -132,14 +125,27 @@ def _read(cls, io, **kwargs):
             while end_of_row_tag not in sheet_block:
                 sheet_block += f.read(EXCEL_READ_BLOCK_SIZE)
             idx_of_header_end = sheet_block.index(end_of_row_tag) + len(end_of_row_tag)
-            sheet_header = sheet_block[:idx_of_header_end]
-            # Reset the file pointer to begin at the end of the header information.
-            f.seek(idx_of_header_end)
+            sheet_header_with_first_row = sheet_block[:idx_of_header_end]
+
+            if kwargs["header"] is not None:
+                # Reset the file pointer to begin at the end of the header information.
+                f.seek(idx_of_header_end)
+                sheet_header = sheet_header_with_first_row
+            else:
+                start_of_row_tag = b"<row"
+                idx_of_header_start = sheet_block.index(start_of_row_tag)
+                sheet_header = sheet_block[:idx_of_header_start]
+                # Reset the file pointer to begin at the end of the header information.
+                f.seek(idx_of_header_start)
+
             kwargs["_header"] = sheet_header
             footer = b"</sheetData></worksheet>"
             # Use openpyxml to parse the data
             reader = WorksheetReader(
-                ws, BytesIO(sheet_header + footer), ex.shared_strings, False
+                ws,
+                BytesIO(sheet_header_with_first_row + footer),
+                ex.shared_strings,
+                False,
             )
             # Attach cells to the worksheet
             reader.bind_cells()
@@ -147,7 +153,10 @@ def _read(cls, io, **kwargs):
                 ws, kwargs.get("convert_float", True)
             )
             # Extract column names from parsed data.
-            column_names = pandas.Index(data[0])
+            if kwargs["header"] is None:
+                column_names = pandas.RangeIndex(len(data[0]))
+            else:
+                column_names = pandas.Index(data[0])
             index_col = kwargs.get("index_col", None)
             # Remove column names that are specified as `index_col`
             if index_col is not None:


Test patch:
diff --git a/modin/pandas/test/test_io.py b/modin/pandas/test/test_io.py
--- a/modin/pandas/test/test_io.py
+++ b/modin/pandas/test/test_io.py
@@ -1885,6 +1885,14 @@ def test_read_excel_every_other_nan(self):
             io="modin/pandas/test/data/every_other_row_nan.xlsx",
         )
 
+    @check_file_leaks
+    def test_read_excel_header_none(self):
+        eval_io(
+            fn_name="read_excel",
+            io="modin/pandas/test/data/every_other_row_nan.xlsx",
+            header=None,
+        )
+
     @pytest.mark.parametrize(
         "sheet_name",
         [