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: Version bump overrides library past fix and undo workarounds #137

Merged
merged 2 commits into from May 13, 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
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