GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: annotate optional integer parameters with optional type by tswast · Pull Request #1487 · googleapis/python-bigquery

This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Conversation

@tswast

@tswast tswast commented Feb 7, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

I noticed in a project that uses this client that the type annotations for result 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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tswast
fix: annotate optional integer parameters with optional type
014a0bc
@tswast
tswast requested review from a team and yirutang February 7, 2023 15:53
@product-auto-label product-auto-label Bot added size: s Pull request size is small. api: bigquery Issues related to the googleapis/python-bigquery API. labels Feb 7, 2023
@tswast
remove google-cloud-core reference causing type checker issues
b2ab776
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Feb 7, 2023
tswast added 2 commits February 7, 2023 10:53
@tswast
unused imports
40d4332
@tswast
more unused imports
db6a15d
@chalmerlowe

chalmerlowe commented Feb 8, 2023

Copy link
Copy Markdown
Collaborator

General question:

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chalmerlowe
chalmerlowe approved these changes Feb 8, 2023
View reviewed changes

@chalmerlowe chalmerlowe left a comment

Copy link
Copy Markdown
Collaborator

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 a general question to the comment thread.
Beyond that question, this LGTM.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tswast

tswast commented Feb 8, 2023

Copy link
Copy Markdown
Contributor Author

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 with https://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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tswast
tswast merged commit a190aaa into main Feb 8, 2023
@tswast
tswast deleted the tswast-type-annotations branch February 8, 2023 16:05
@release-please release-please Bot mentioned this pull request Feb 8, 2023
chore(main): release 3.6.0 #1490
Merged
This was referenced Feb 28, 2023
[BQ] February 27, 2023 kitta65/bq-extension-vscode#141
Closed
[BQ] February 27, 2023 kitta65/prettier-plugin-bq#148
Closed
[BQ] February 27, 2023 kitta65/bq2cst#156
Closed
abdelmegahedgoogle pushed a commit to abdelmegahedgoogle/python-bigquery that referenced this pull request Apr 17, 2023
@tswast @abdelmegahedgoogle
fix: annotate optional integer parameters with optional type (googlea…
dd21845
…pis#1487)

* fix: annotate optional integer parameters with optional type

* remove google-cloud-core reference causing type checker issues

deps: update minimum google-cloud-core  to 1.6.0
@tswast tswast mentioned this pull request Nov 6, 2023
refactor version checks for pandas, pyarrow #769
Closed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@yirutang yirutang Awaiting requested review from yirutang
1 more reviewer
@chalmerlowe chalmerlowe chalmerlowe approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api: bigquery Issues related to the googleapis/python-bigquery API. size: m Pull 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

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@tswast @chalmerlowe
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.