Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: annotate optional integer parameters with optional type#1487

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tswast merged 4 commits intomainfromtswast-type-annotations
Feb 8, 2023

Conversation

@tswast
Copy link
Contributor

@tswasttswast commentedFeb 7, 2023
edited
Loading

I noticed in a project that uses this client that the type annotations forresult are incorrect.

bigframes/dataframe.py:64: error: Argument "max_results" to "result" of "QueryJob" has incompatible type "Optional[int]"; expected "int"  [arg-type]

Fixes#509

@tswasttswast requested a review froma teamFebruary 7, 2023 15:53
@tswasttswast requested a review froma team as acode ownerFebruary 7, 2023 15:53
@tswasttswast requested a review fromyirutangFebruary 7, 2023 15:53
@product-auto-labelproduct-auto-labelbot added size: sPull request size is small. api: bigqueryIssues related to the googleapis/python-bigquery API. labelsFeb 7, 2023
@product-auto-labelproduct-auto-labelbot added size: mPull request size is medium. and removed size: sPull request size is small. labelsFeb 7, 2023
@chalmerlowe
Copy link
Collaborator

General question:

what was the criteria for deciding which parameters should get the enhanced Type Annotation?

Noticed some otherint parameters in various methods that did not get the same enhancement and was curious.

Copy link
Collaborator

@chalmerlowechalmerlowe left a comment

Choose a reason for hiding this comment

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

Added a general question to the comment thread.
Beyond that question, this LGTM.

@tswast
Copy link
ContributorAuthor

what was the criteria for deciding which parameters should get the enhanced Type Annotation?
Noticed some other int parameters in various methods that did not get the same enhancement and was curious.

Our approach was: when you touch a method, add type annotations.

At the time, that meant we could also remove the type information from the docstring because it was then redundant information from what Sphinx generated and what we put in the docstring. Looks to be the same withhttps://cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.client.Client but I'm not 100% sure how the linking works over there since they don't use intersphinx.

@tswasttswast merged commita190aaa intomainFeb 8, 2023
@tswasttswast deleted the tswast-type-annotations branchFebruary 8, 2023 16:05
@release-pleaserelease-pleasebot mentioned this pull requestFeb 8, 2023
abdelmegahedgoogle pushed a commit to abdelmegahedgoogle/python-bigquery that referenced this pull requestApr 17, 2023
…pis#1487)* fix: annotate optional integer parameters with optional type* remove google-cloud-core reference causing type checker issuesdeps: update minimum google-cloud-core  to 1.6.0
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@chalmerlowechalmerlowechalmerlowe approved these changes

@yirutangyirutangAwaiting requested review from yirutang

Assignees

No one assigned

Labels

api: bigqueryIssues related to the googleapis/python-bigquery API.size: mPull request size is medium.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

increase minimum version of google-cloud-core to 1.6.0

2 participants

@tswast@chalmerlowe

[8]ページ先頭

©2009-2025 Movatter.jp