This is an automated email from the ASF dual-hosted git repository.

xyz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-client-python.git


The following commit(s) were added to refs/heads/main by this push:
     new d1727cf  Fix incorrect type hints in Client (#204)
d1727cf is described below

commit d1727cf7432f49c7da81dab36b51277be772dd01
Author: Yunze Xu <[email protected]>
AuthorDate: Thu Mar 21 13:18:00 2024 +0800

    Fix incorrect type hints in Client (#204)
    
    Fixes https://github.com/apache/pulsar-client-python/issues/188
---
 pulsar/__init__.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/pulsar/__init__.py b/pulsar/__init__.py
index 99b225f..a46c209 100644
--- a/pulsar/__init__.py
+++ b/pulsar/__init__.py
@@ -43,7 +43,7 @@ Read the instructions on `source code repository
 """
 
 import logging
-from typing import List, Tuple, Optional
+from typing import List, Tuple, Optional, Union
 
 import _pulsar
 
@@ -627,7 +627,7 @@ class Client:
                         properties=None,
                         batching_type: BatchingType = BatchingType.Default,
                         encryption_key=None,
-                        crypto_key_reader: CryptoKeyReader = None,
+                        crypto_key_reader: Union[None, CryptoKeyReader] = None,
                         access_mode: ProducerAccessMode = 
ProducerAccessMode.Shared,
                         ):
         """
@@ -804,7 +804,7 @@ class Client:
                   properties=None,
                   pattern_auto_discovery_period=60,
                   initial_position: InitialPosition = InitialPosition.Latest,
-                  crypto_key_reader: CryptoKeyReader = None,
+                  crypto_key_reader: Union[None, CryptoKeyReader] = None,
                   replicate_subscription_state_enabled=False,
                   max_pending_chunked_message=10,
                   auto_ack_oldest_chunked_message_on_queue_full=False,
@@ -813,7 +813,7 @@ class Client:
                   key_shared_policy=None,
                   batch_index_ack_enabled=False,
                   regex_subscription_mode: RegexSubscriptionMode = 
RegexSubscriptionMode.PersistentOnly,
-                  dead_letter_policy: ConsumerDeadLetterPolicy = None,
+                  dead_letter_policy: Union[None, ConsumerDeadLetterPolicy] = 
None,
                   ):
         """
         Subscribe to the given topic and subscription combination.
@@ -1005,7 +1005,7 @@ class Client:
                       reader_name=None,
                       subscription_role_prefix=None,
                       is_read_compacted=False,
-                      crypto_key_reader: CryptoKeyReader = None,
+                      crypto_key_reader: Union[None, CryptoKeyReader] = None,
                       start_message_id_inclusive=False
                       ):
         """

Reply via email to