Skip to content
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

Typing of timeout #1545

Closed
boennecd opened this issue Apr 5, 2023 · 1 comment · Fixed by #1554
Closed

Typing of timeout #1545

boennecd opened this issue Apr 5, 2023 · 1 comment · Fixed by #1554
Assignees
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@boennecd
Copy link

boennecd commented Apr 5, 2023

Environment details

  • OS type and version: MacOs
  • Python version: 3.9.6

Steps to reproduce

This is fairly tiny and relates to a typing issue. timeout is documented as Optional[float] but only typed as float. E.g.

timeout: float = None,

timeout (Optional[float]):
The number of seconds to wait for the underlying HTTP transport
before using ``retry``.
If multiple requests are made under the hood, ``timeout``
applies to each individual request.

and also at

self, retry: "retries.Retry" = DEFAULT_RETRY, timeout: float = None

timeout (Optional[float]):
The number of seconds to wait for the underlying HTTP transport
before using ``retry``.
If multiple requests are made under the hood, ``timeout``
applies to each individual request.

The type check is ignored in both cases which may explain this?

def result( # type: ignore # (complaints about the overloaded signature)

def result( # type: ignore # (signature complaint)

This makes the functions slightly annoying to use if one passes an Optional[float] on.

@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Apr 5, 2023
@tswast
Copy link
Contributor

tswast commented Apr 18, 2023

Thanks for the report! I've mailed #1554 to fix this and a few other areas where None is accepted.

@tswast tswast self-assigned this Apr 18, 2023
@tswast tswast added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Apr 18, 2023
gcf-merge-on-green bot pushed a commit that referenced this issue Jun 22, 2023
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](https://togithub.com/googleapis/python-bigquery/issues/new/choose) 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 #1545 🦕
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 API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants