Skip to content

Commit

Permalink
fix(python): Fix type hint for IO *_options arguments (#5852)
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Dec 19, 2022
1 parent 652623d commit 0b05856
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions py-polars/polars/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def read_csv(
low_memory: bool = False,
rechunk: bool = True,
use_pyarrow: bool = False,
storage_options: dict[str, object] | None = None,
storage_options: dict[str, Any] | None = None,
skip_rows_after_header: int = 0,
row_count_name: str | None = None,
row_count_offset: int = 0,
Expand Down Expand Up @@ -593,7 +593,7 @@ def scan_ipc(
rechunk: bool = True,
row_count_name: str | None = None,
row_count_offset: int = 0,
storage_options: dict[str, object] | None = None,
storage_options: dict[str, Any] | None = None,
memory_map: bool = True,
) -> LazyFrame:
"""
Expand Down Expand Up @@ -648,7 +648,7 @@ def scan_parquet(
rechunk: bool = True,
row_count_name: str | None = None,
row_count_offset: int = 0,
storage_options: dict[str, object] | None = None,
storage_options: dict[str, Any] | None = None,
low_memory: bool = False,
) -> LazyFrame:
"""
Expand Down Expand Up @@ -789,7 +789,7 @@ def read_ipc(
n_rows: int | None = None,
use_pyarrow: bool = False,
memory_map: bool = True,
storage_options: dict[str, object] | None = None,
storage_options: dict[str, Any] | None = None,
row_count_name: str | None = None,
row_count_offset: int = 0,
rechunk: bool = True,
Expand Down Expand Up @@ -875,12 +875,12 @@ def read_parquet(
n_rows: int | None = None,
use_pyarrow: bool = False,
memory_map: bool = True,
storage_options: dict[str, object] | None = None,
storage_options: dict[str, Any] | None = None,
parallel: ParallelStrategy = "auto",
row_count_name: str | None = None,
row_count_offset: int = 0,
low_memory: bool = False,
pyarrow_options: dict[str, object] | None = None,
pyarrow_options: dict[str, Any] | None = None,
) -> DataFrame:
"""
Read into a DataFrame from a parquet file.
Expand Down Expand Up @@ -1121,8 +1121,8 @@ def read_excel(
file: str | BytesIO | Path | BinaryIO | bytes,
sheet_id: Literal[None],
sheet_name: Literal[None],
xlsx2csv_options: dict[str, object] | None,
read_csv_options: dict[str, object] | None,
xlsx2csv_options: dict[str, Any] | None,
read_csv_options: dict[str, Any] | None,
) -> dict[str, DataFrame]:
...

Expand All @@ -1132,8 +1132,8 @@ def read_excel(
file: str | BytesIO | Path | BinaryIO | bytes,
sheet_id: Literal[None],
sheet_name: str,
xlsx2csv_options: dict[str, object] | None = None,
read_csv_options: dict[str, object] | None = None,
xlsx2csv_options: dict[str, Any] | None = None,
read_csv_options: dict[str, Any] | None = None,
) -> DataFrame:
...

Expand All @@ -1143,8 +1143,8 @@ def read_excel(
file: str | BytesIO | Path | BinaryIO | bytes,
sheet_id: int,
sheet_name: Literal[None],
xlsx2csv_options: dict[str, object] | None = None,
read_csv_options: dict[str, object] | None = None,
xlsx2csv_options: dict[str, Any] | None = None,
read_csv_options: dict[str, Any] | None = None,
) -> DataFrame:
...

Expand All @@ -1153,8 +1153,8 @@ def read_excel(
file: str | BytesIO | Path | BinaryIO | bytes,
sheet_id: int | None = 1,
sheet_name: str | None = None,
xlsx2csv_options: dict[str, object] | None = None,
read_csv_options: dict[str, object] | None = None,
xlsx2csv_options: dict[str, Any] | None = None,
read_csv_options: dict[str, Any] | None = None,
) -> DataFrame | dict[str, DataFrame]:
"""
Read Excel (XLSX) sheet into a DataFrame.
Expand Down Expand Up @@ -1263,7 +1263,7 @@ def _read_excel_sheet(
parser: Any,
sheet_id: int | None,
sheet_name: str | None,
read_csv_options: dict[str, object] | None,
read_csv_options: dict[str, Any] | None,
) -> DataFrame:
csv_buffer = StringIO()

Expand All @@ -1280,8 +1280,8 @@ def _read_excel_sheet(
def _get_delta_lake_table(
table_path: str,
version: int | None = None,
storage_options: dict[str, object] | None = None,
delta_table_options: dict[str, object] | None = None,
storage_options: dict[str, Any] | None = None,
delta_table_options: dict[str, Any] | None = None,
) -> deltalake.DeltaTable:
"""
Initialise a Delta lake table for use in read and scan operations.
Expand Down Expand Up @@ -1332,9 +1332,9 @@ def scan_delta(
table_uri: str,
version: int | None = None,
raw_filesystem: pa.fs.FileSystem | None = None,
storage_options: dict[str, object] | None = None,
delta_table_options: dict[str, object] | None = None,
pyarrow_options: dict[str, object] | None = None,
storage_options: dict[str, Any] | None = None,
delta_table_options: dict[str, Any] | None = None,
pyarrow_options: dict[str, Any] | None = None,
) -> LazyFrame:
"""
Lazily read from a Delta lake table.
Expand Down Expand Up @@ -1507,9 +1507,9 @@ def read_delta(
table_uri: str,
version: int | None = None,
columns: list[str] | None = None,
storage_options: dict[str, object] | None = None,
delta_table_options: dict[str, object] | None = None,
pyarrow_options: dict[str, object] | None = None,
storage_options: dict[str, Any] | None = None,
delta_table_options: dict[str, Any] | None = None,
pyarrow_options: dict[str, Any] | None = None,
) -> DataFrame:
"""
Reads into a DataFrame from a Delta lake table.
Expand Down

0 comments on commit 0b05856

Please sign in to comment.