-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
TPY: Add Types to gbq.py #30632
TPY: Add Types to gbq.py #30632
Conversation
query: str, | ||
project_id: Optional[str] = None, | ||
index_col: Optional[str] = None, | ||
col_order: Optional[List[str]] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this explicitly need to be a List or does Sequence work as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh good point - tried the other basic sequence types and they throw. Since it's used to retrieve columns from a DataFrame. Like df[col_order]
. So think List
it is!
pandas/io/gbq.py
Outdated
auth_local_webserver: bool = False, | ||
dialect: Optional[str] = None, | ||
location: Optional[str] = None, | ||
configuration: Optional[Dict] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can subtypes be added for Dict here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added Dict[str, Any]
since it is essentially key value pairs that are sent to the GBQ api. Unsure if we can be any stricter on the values?
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query
thanks @alimcmaster1 you might want to push these annotations to pandas-gbq as well |
Thanks will do! |
Add Types to args for
to_gbq
andread_gbq
.