|
3 | 3 | from io import BufferedIOBase, BytesIO, RawIOBase
|
4 | 4 | import os
|
5 | 5 | from textwrap import fill
|
6 |
| -from typing import Any, List, Mapping, Optional, Union |
| 6 | +from typing import Any, Mapping, Union |
7 | 7 |
|
8 | 8 | from pandas._config import config
|
9 | 9 |
|
10 | 10 | from pandas._libs.parsers import STR_NA_VALUES
|
11 |
| -from pandas._typing import Scalar, StorageOptions |
| 11 | +from pandas._typing import StorageOptions |
12 | 12 | from pandas.errors import EmptyDataError
|
13 | 13 | from pandas.util._decorators import Appender, deprecate_nonkeyword_arguments
|
14 | 14 |
|
@@ -398,14 +398,7 @@ def get_sheet_by_index(self, index):
|
398 | 398 | pass
|
399 | 399 |
|
400 | 400 | @abc.abstractmethod
|
401 |
| - def get_sheet_data( |
402 |
| - self, |
403 |
| - sheet, |
404 |
| - convert_float: bool, |
405 |
| - header_nrows: int, |
406 |
| - skiprows_nrows: int, |
407 |
| - nrows: Optional[int], |
408 |
| - ) -> List[List[Scalar]]: |
| 401 | + def get_sheet_data(self, sheet, convert_float): |
409 | 402 | pass
|
410 | 403 |
|
411 | 404 | def parse(
|
@@ -461,22 +454,7 @@ def parse(
|
461 | 454 | else: # assume an integer if not a string
|
462 | 455 | sheet = self.get_sheet_by_index(asheetname)
|
463 | 456 |
|
464 |
| - if isinstance(header, int): |
465 |
| - header_nrows = header |
466 |
| - elif header is None: |
467 |
| - header_nrows = 0 |
468 |
| - else: |
469 |
| - header_nrows = max(header) |
470 |
| - if isinstance(skiprows, int): |
471 |
| - skiprows_nrows = skiprows |
472 |
| - elif skiprows is None: |
473 |
| - skiprows_nrows = 0 |
474 |
| - else: |
475 |
| - skiprows_nrows = len(skiprows) |
476 |
| - |
477 |
| - data = self.get_sheet_data( |
478 |
| - sheet, convert_float, header_nrows, skiprows_nrows, nrows |
479 |
| - ) |
| 457 | + data = self.get_sheet_data(sheet, convert_float) |
480 | 458 | usecols = maybe_convert_usecols(usecols)
|
481 | 459 |
|
482 | 460 | if not data:
|
|
0 commit comments