Skip to content

WIP add some missing Optional type annotations #1315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MarcoGorelli
Copy link
Member

These are some cases where the overloads indicate that they are meant to match the parameter defaults, which in all these cases are = None. However, None is currently missing from the annotations for these parameters

  • Closes #xxxx (Replace xxxx with the Github issue number)
  • Tests added: Please use assert_type() to assert the type of any return value

Comment on lines 313 to 314
start: int = ...,
end: int = ...,
start: int | None = ...,
end: int | None = ...,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

columns: list[str] = ...,
columns: list[str] | None = ...,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MarcoGorelli MarcoGorelli marked this pull request as draft August 11, 2025 17:27
@MarcoGorelli MarcoGorelli changed the title add some missing Optional type annotations WIP add some missing Optional type annotations Aug 11, 2025
Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to fix the other defaults for read_sql() that would be good as well, but not a problem if you don't.

@@ -115,7 +115,7 @@ def read_sql(
| None
) = ...,
parse_dates: list[str] | dict[str, str] | dict[str, dict[str, Any]] | None = ...,
columns: list[str] = ...,
columns: list[str] | None = ...,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like #1293 missed the defaults for read_sql(). So can you make this columns: list[str] | None = None (and below as well)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants