Skip to content

Commit

Permalink
fix: Version bump overrides library past fix and undo workarounds (#137)
Browse files Browse the repository at this point in the history
* fix: Version bump overrides library past fix and undo workarounds

* run blacken
  • Loading branch information
dpcollins-google committed May 13, 2021
1 parent 5845a6d commit 94ae2f0
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
Expand Up @@ -47,7 +47,7 @@ def publish(
data: bytes,
ordering_key: str = "",
**attrs: Mapping[str, str]
) -> Future:
) -> "Future[str]":
if isinstance(topic, str):
topic = TopicPath.parse(topic)
publisher = self._multiplexer.get_or_create(
Expand Down
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

from concurrent.futures.thread import ThreadPoolExecutor
from typing import Union, Optional, Set, Callable, cast
from typing import Union, Optional, Set

from google.cloud.pubsub_v1.subscriber.futures import StreamingPullFuture

Expand Down Expand Up @@ -61,13 +61,12 @@ def cancel_streaming_pull_future(fut: StreamingPullFuture):
def subscribe(
self,
subscription: Union[SubscriptionPath, str],
callback: Callable, # TODO(dpcollins): Change to MessageCallback,
callback: MessageCallback,
per_partition_flow_control_settings: FlowControlSettings,
fixed_partitions: Optional[Set[Partition]] = None,
) -> StreamingPullFuture:
if isinstance(subscription, str):
subscription = SubscriptionPath.parse(subscription)
callback = cast(MessageCallback, callback)

def create_and_open():
underlying = self._underlying_factory(
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:
) -> "Future[str]":
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:
) -> "Future[str]":
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:
) -> "Future[str]":
"""
Publish a message.
Expand Down
5 changes: 3 additions & 2 deletions google/cloud/pubsublite/cloudpubsub/subscriber_client.py
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

from concurrent.futures.thread import ThreadPoolExecutor
from typing import Optional, Union, Set, AsyncIterator, Callable
from typing import Optional, Union, Set, AsyncIterator

from google.api_core.client_options import ClientOptions
from google.auth.credentials import Credentials
Expand All @@ -34,6 +34,7 @@
from google.cloud.pubsublite.cloudpubsub.subscriber_client_interface import (
SubscriberClientInterface,
AsyncSubscriberClientInterface,
MessageCallback,
)
from google.cloud.pubsublite.internal.constructable_from_service_account import (
ConstructableFromServiceAccount,
Expand Down Expand Up @@ -99,7 +100,7 @@ def __init__(
def subscribe(
self,
subscription: Union[SubscriptionPath, str],
callback: Callable, # TODO(dpcollins): Change to MessageCallback,
callback: MessageCallback,
per_partition_flow_control_settings: FlowControlSettings,
fixed_partitions: Optional[Set[Partition]] = None,
) -> StreamingPullFuture:
Expand Down
Expand Up @@ -81,7 +81,7 @@ class SubscriberClientInterface(ContextManager):
def subscribe(
self,
subscription: Union[SubscriptionPath, str],
callback: Callable, # TODO(dpcollins): Change to MessageCallback,
callback: MessageCallback,
per_partition_flow_control_settings: FlowControlSettings,
fixed_partitions: Optional[Set[Partition]] = None,
) -> StreamingPullFuture:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -29,7 +29,7 @@

dependencies = [
"google-cloud-pubsub >= 2.1.0, <3.0.0dev",
"overrides>=2.0.0, <7.0.0",
"overrides>=6.0.1, <7.0.0",
]

setuptools.setup(
Expand Down

0 comments on commit 94ae2f0

Please sign in to comment.