Skip to content

Commit

Permalink
fix: Remove Future type hint from return type which fails to type che…
Browse files Browse the repository at this point in the history
…ck when overridden (#133)
  • Loading branch information
dpcollins-google committed May 5, 2021
1 parent 811434e commit abe9b14
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
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
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
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
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

0 comments on commit abe9b14

Please sign in to comment.