Skip to content

Commit abe9b14

Browse files
fix: Remove Future type hint from return type which fails to type check when overridden (#133)
1 parent 811434e commit abe9b14

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

google/cloud/pubsublite/cloudpubsub/internal/multiplexed_publisher_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def publish(
4747
data: bytes,
4848
ordering_key: str = "",
4949
**attrs: Mapping[str, str]
50-
) -> "Future[str]":
50+
) -> Future:
5151
if isinstance(topic, str):
5252
topic = TopicPath.parse(topic)
5353
publisher = self._multiplexer.get_or_create(

google/cloud/pubsublite/cloudpubsub/internal/publisher_impl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def __init__(self, underlying: AsyncSinglePublisher):
3535

3636
def publish(
3737
self, data: bytes, ordering_key: str = "", **attrs: Mapping[str, str]
38-
) -> "Future[str]":
38+
) -> Future:
3939
return self._managed_loop.submit(
4040
self._underlying.publish(data=data, ordering_key=ordering_key, **attrs)
4141
)

google/cloud/pubsublite/cloudpubsub/publisher_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def publish(
9494
data: bytes,
9595
ordering_key: str = "",
9696
**attrs: Mapping[str, str]
97-
) -> "Future[str]":
97+
) -> Future:
9898
self._require_stared.require_started()
9999
return self._impl.publish(
100100
topic=topic, data=data, ordering_key=ordering_key, **attrs

google/cloud/pubsublite/cloudpubsub/publisher_client_interface.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def publish(
6767
data: bytes,
6868
ordering_key: str = "",
6969
**attrs: Mapping[str, str],
70-
) -> "Future[str]":
70+
) -> Future:
7171
"""
7272
Publish a message.
7373
@@ -78,7 +78,8 @@ def publish(
7878
**attrs: Additional attributes to send.
7979
8080
Returns:
81-
A future completed with an ack id, which can be decoded using MessageMetadata.decode.
81+
A future completed with an ack id of type str, which can be decoded using
82+
MessageMetadata.decode.
8283
8384
Raises:
8485
GoogleApiCallError: On a permanent failure.

0 commit comments

Comments
 (0)