Skip to content

Commit d1727cf

Browse files
Fix incorrect type hints in Client (#204)
Fixes #188
1 parent af6a555 commit d1727cf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pulsar/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"""
4444

4545
import logging
46-
from typing import List, Tuple, Optional
46+
from typing import List, Tuple, Optional, Union
4747

4848
import _pulsar
4949

@@ -627,7 +627,7 @@ def create_producer(self, topic,
627627
properties=None,
628628
batching_type: BatchingType = BatchingType.Default,
629629
encryption_key=None,
630-
crypto_key_reader: CryptoKeyReader = None,
630+
crypto_key_reader: Union[None, CryptoKeyReader] = None,
631631
access_mode: ProducerAccessMode = ProducerAccessMode.Shared,
632632
):
633633
"""
@@ -804,7 +804,7 @@ def subscribe(self, topic, subscription_name,
804804
properties=None,
805805
pattern_auto_discovery_period=60,
806806
initial_position: InitialPosition = InitialPosition.Latest,
807-
crypto_key_reader: CryptoKeyReader = None,
807+
crypto_key_reader: Union[None, CryptoKeyReader] = None,
808808
replicate_subscription_state_enabled=False,
809809
max_pending_chunked_message=10,
810810
auto_ack_oldest_chunked_message_on_queue_full=False,
@@ -813,7 +813,7 @@ def subscribe(self, topic, subscription_name,
813813
key_shared_policy=None,
814814
batch_index_ack_enabled=False,
815815
regex_subscription_mode: RegexSubscriptionMode = RegexSubscriptionMode.PersistentOnly,
816-
dead_letter_policy: ConsumerDeadLetterPolicy = None,
816+
dead_letter_policy: Union[None, ConsumerDeadLetterPolicy] = None,
817817
):
818818
"""
819819
Subscribe to the given topic and subscription combination.
@@ -1005,7 +1005,7 @@ def create_reader(self, topic, start_message_id,
10051005
reader_name=None,
10061006
subscription_role_prefix=None,
10071007
is_read_compacted=False,
1008-
crypto_key_reader: CryptoKeyReader = None,
1008+
crypto_key_reader: Union[None, CryptoKeyReader] = None,
10091009
start_message_id_inclusive=False
10101010
):
10111011
"""

0 commit comments

Comments
 (0)