Skip to content

The PullResponse docstring is inaccurate #717

@hjtran

Description

@hjtran
class PullResponse(proto.Message):
    r"""Response for the ``Pull`` method.
    Attributes:
        received_messages (Sequence[google.pubsub_v1.types.ReceivedMessage]):
            Received Pub/Sub messages. The list will be empty if there
            are no more messages available in the backlog. For JSON, the
            response can be entirely empty. The Pub/Sub system may
            return fewer than the ``maxMessages`` requested even if
            there are more messages available in the backlog.
    """

The PullResponse docstring states that the received_messages ... will be empty if there are no more messages available in the backlog.

From my conversation with @kamalaboulhosn on the GCP slack, this is incorrect. Kamal mentioned that there was a doc overhaul coming that would fix it but I wonder if it might save someone else some time (we spent an embarrassing amount of dev/cpu time debugging our application which was built on this statement) if this part of the docstring was removed altogether.

Metadata

Metadata

Assignees

Labels

api: pubsubIssues related to the googleapis/python-pubsub API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions