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

fix: Remove Future type hint from return type which fails to type check when overridden #133

Merged
merged 1 commit into from
May 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def publish(
data: bytes,
ordering_key: str = "",
**attrs: Mapping[str, str]
) -> "Future[str]":
) -> Future:
if isinstance(topic, str):
topic = TopicPath.parse(topic)
publisher = self._multiplexer.get_or_create(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self, underlying: AsyncSinglePublisher):

def publish(
self, data: bytes, ordering_key: str = "", **attrs: Mapping[str, str]
) -> "Future[str]":
) -> Future:
return self._managed_loop.submit(
self._underlying.publish(data=data, ordering_key=ordering_key, **attrs)
)
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/pubsublite/cloudpubsub/publisher_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def publish(
data: bytes,
ordering_key: str = "",
**attrs: Mapping[str, str]
) -> "Future[str]":
) -> Future:
self._require_stared.require_started()
return self._impl.publish(
topic=topic, data=data, ordering_key=ordering_key, **attrs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def publish(
data: bytes,
ordering_key: str = "",
**attrs: Mapping[str, str],
) -> "Future[str]":
) -> Future:
"""
Publish a message.

Expand All @@ -78,7 +78,8 @@ def publish(
**attrs: Additional attributes to send.

Returns:
A future completed with an ack id, which can be decoded using MessageMetadata.decode.
A future completed with an ack id of type str, which can be decoded using
MessageMetadata.decode.

Raises:
GoogleApiCallError: On a permanent failure.
Expand Down