Skip to content
This repository was archived by the owner on Mar 9, 2026. It is now read-only.
This repository was archived by the owner on Mar 9, 2026. It is now read-only.

Timeout argument throw exception as wrong type (str v.s. float expected) (Snippet sample) #1017

@changlichuan

Description

@changlichuan

Minor issue in "python-pubsub/samples/snippets/quickstart/sub.py"

Environment details

  • OS type and version: macOS Sonoma 14.1
  • Python version: Python 3.10.11
  • pip version: pip 23.0.1
  • google-cloud-pubsub version: Version: 2.18.4

Steps to reproduce

  1. Start a simple pub/sub system on GCP (for example follow guide https://cloud.google.com/pubsub/docs/building-pubsub-messaging-system)
  2. as per the sample, instead of starting subscriber with "python sub.py $PROJECT sub_one" without a timeout argument, give it any timeout value.
  3. subscriber will exit immediately due to exception, as timeout is in str type, un-matching float type expected in code "streaming_pull_future.result(timeout=timeout)"
  4. in addition, help message on line 60 is inaccurate.

Exception captured:

'>' not supported between instances of 'str' and 'int'

Metadata

Metadata

Labels

api: pubsubIssues related to the googleapis/python-pubsub API.samplesIssues that are directly related to samples.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions