-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Summary
As an ETL Helper user, I want to fix the typing errors that I get when I use ETL Helper, so that I can use type hints to help me.
Description
There are two scenarios where Pylance (the Python type checker in VS Code) marks a typing error in code that uses ETL Helper:
def select_names(conn: sqlite3.Connection) -> list[str]:
return list(row["name"] for row in etl.iter_rows("SELECT name FROM my_table", conn))
Pylance complains with:
- "__getitem__" method not defined on type "Row" (Pylance reportIndexIssue)
- Argument of type "Connection" cannot be assigned to parameter "conn" of type "Connection" in function "iter_rows"
"Connection" is incompatible with protocol "Connection"
"cursor" is an incompatible type
No overloaded function matches type "() -> None" (Pylance reportArgumentType)
It should be possible to update the type hints with ETLHelper so that these errors are not thrown.
Acceptance criteria
- Error on connection type is resolved
- Error on row type is resolved
Metadata
Metadata
Assignees
Labels
No labels