Skip to content

fix: add type hint for progress_bar_type in read_gbq function #935

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

Closed
wants to merge 1 commit into from

Conversation

haru-256
Copy link

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #934

@haru-256 haru-256 requested review from a team as code owners June 28, 2025 14:04
@haru-256 haru-256 requested review from Linchin and Genesis929 June 28, 2025 14:04
@product-auto-label product-auto-label bot added size: xs Pull request size is extra small. api: bigquery Issues related to the googleapis/python-bigquery-pandas API. labels Jun 28, 2025
@Linchin Linchin added kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Jun 30, 2025
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Jun 30, 2025
@Linchin Linchin added the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 30, 2025
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 30, 2025
@haru-256
Copy link
Author

haru-256 commented Jul 9, 2025

@Genesis929
Could you please review this?

@chalmerlowe
Copy link
Collaborator

@Genesis929 Could you please review this?

@haru-256:

I am the maintainer (along with @Linchin) of this library. @Linchin and I decide what gets accepted or not.

@Linchin asked a question about this problem on Issue #934 but they did not get a response:

Can you tell us more about how the error was raised? Was it blocking you from executing the code, or it's a notification from your IDE?

Please be aware that:

  • We do not enforce or check type hinting in this library (although some parts of the code, for good or bad, have legacy type hints).
  • We do not guarantee that we will support type hinting.
  • We do not have the addition of type hint CI/CD checks on our roadmap.
  • If the code fails to execute under normal use cases, that is one thing, but failing due to a type hinter that we don't use OR guarantee is not a priority.

In looking at the merits of this PR, it is not testable under our current infrastructure, since we don't have type hinting in our CI/CD pipeline.

Why do I go on about type hinting? In looking at the error you posted:

Argument of type "None" cannot be assigned to parameter "progress_bar_type" of type "str" in function "read_gbq"
"None" is not assignable to "str"

The error message appears to be from the pyright tool maintained by Microsoft.

Here is a similar example.

pyright: Argument of type "Literal[1]" cannot be assigned to parameter "x" of type "str" in function "f"

Here is a link to the strings that generate that style of error message: https://github.com/microsoft/pyright/blob/5ba9dcf9802382b4db529221ba353ae3edc597ad/packages/pyright-internal/src/localization/package.nls.en-us.json#L43

Mypy uses a slightly more cryptic verbiage:

mypy: Argument x to "f" has incompatible type "int"; expected "str"

@haru-256
Copy link
Author

haru-256 commented Jul 9, 2025

Sorry for the late reply, I missed this notification.
I understand that you are not planning to support type hints.

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-pandas API. size: xs Pull request size is extra small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type Annotation Error of progress_bar_type in read_gbq function
4 participants