Skip to content

Commit

Permalink
Use Optional correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
ximenesuk committed Sep 13, 2023
1 parent f909e3b commit ad36e85
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions etlhelper/etl.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def iter_chunks(
conn: Connection,
parameters: tuple = (),
row_factory: Callable = dict_row_factory,
transform: Callable[[Chunk], Chunk] = Optional,
transform: Optional[Callable[[Chunk], Chunk]] = None,
chunk_size: int = CHUNKSIZE
) -> Iterator[Chunk]:
"""
Expand Down Expand Up @@ -145,7 +145,7 @@ def iter_rows(
conn: Connection,
parameters: tuple = (),
row_factory: Callable = dict_row_factory,
transform: Callable[[Chunk], Chunk] = Optional,
transform: Optional[Callable[[Chunk], Chunk]] = None,
chunk_size: int = CHUNKSIZE
) -> Iterator[Row]:
"""
Expand Down Expand Up @@ -173,7 +173,7 @@ def fetchone(
conn: Connection,
parameters: tuple = (),
row_factory: Callable = dict_row_factory,
transform: Callable[[Chunk], Chunk] = Optional,
transform: Optional[Callable[[Chunk], Chunk]] = None,
chunk_size: int = 1
) -> Row:
"""
Expand Down Expand Up @@ -206,7 +206,7 @@ def fetchall(
conn: Connection,
parameters: tuple = (),
row_factory: Callable = dict_row_factory,
transform: Callable[[Chunk], Chunk] = Optional,
transform: Optional[Callable[[Chunk], Chunk]] = None,
chunk_size: int = CHUNKSIZE
) -> Chunk:
"""
Expand All @@ -228,8 +228,8 @@ def executemany(
query: str,
conn: Connection,
rows: list[tuple[Any]],
transform: Callable[[Chunk], Chunk] = Optional,
on_error: Callable = Optional,
transform: Optional[Callable[[Chunk], Chunk]] = None,
on_error: Optional[Callable] = None,
commit_chunks: bool = True,
chunk_size: int = CHUNKSIZE,
) -> tuple[int, int]:
Expand Down Expand Up @@ -367,8 +367,8 @@ def copy_rows(
dest_conn: Connection,
parameters: tuple = (),
row_factory: Callable = dict_row_factory,
transform: Callable[[Chunk], Chunk] = Optional,
on_error: Callable = Optional,
transform: Optional[Callable[[Chunk], Chunk]] = None,
on_error: Optional[Callable] = None,
commit_chunks: bool = True,
chunk_size: int = CHUNKSIZE,
) -> tuple[int, int]:
Expand Down Expand Up @@ -451,10 +451,10 @@ def copy_table_rows(
table: str,
source_conn: Connection,
dest_conn: Connection,
target: str = Optional,
target: Optional[str] = None,
row_factory: Callable = dict_row_factory,
transform: Callable[[Chunk], Chunk] = Optional,
on_error: Callable = Optional,
transform: Optional[Callable[[Chunk], Chunk]] = None,
on_error: Optional[Callable] = None,
commit_chunks: bool = True,
chunk_size: int = CHUNKSIZE
) -> tuple[int, int]:
Expand Down Expand Up @@ -505,8 +505,8 @@ def load(
table: str,
conn: Connection,
rows: list,
transform: Callable = Optional,
on_error: Callable = Optional,
transform: Optional[Callable[[Chunk], Chunk]] = None,
on_error: Optional[Callable] = None,
commit_chunks: bool = True,
chunk_size: int = CHUNKSIZE,
) -> tuple[int, int]:
Expand Down

0 comments on commit ad36e85

Please sign in to comment.