diff --git a/faststream/confluent/client.py b/faststream/confluent/client.py index 9c22cc2e89..1e38085b4b 100644 --- a/faststream/confluent/client.py +++ b/faststream/confluent/client.py @@ -3,6 +3,7 @@ from ssl import SSLContext from time import time from typing import ( + TYPE_CHECKING, Any, Callable, Dict, @@ -17,11 +18,13 @@ from confluent_kafka import Consumer, KafkaError, KafkaException, Message, Producer from confluent_kafka.admin import AdminClient, NewTopic from pydantic import BaseModel -from typing_extensions import Annotated, Doc from faststream.log import logger from faststream.utils.functions import call_or_await +if TYPE_CHECKING: + from faststream.types import LoggerProto + _missing = object() @@ -107,10 +110,7 @@ def __init__( sasl_kerberos_service_name: str = "kafka", sasl_kerberos_domain_name: Optional[str] = None, sasl_oauth_token_provider: Optional[str] = None, - logger: Annotated[ - Union[logging.Logger, None, object], - Doc("User specified logger to pass into Context and log service messages."), - ] = logger, + logger: Optional[Union["LoggerProto", logging.Logger]] = logger, ) -> None: self.logger = logger if isinstance(bootstrap_servers, Iterable) and not isinstance( @@ -302,10 +302,7 @@ def __init__( sasl_kerberos_service_name: str = "kafka", sasl_kerberos_domain_name: Optional[str] = None, sasl_oauth_token_provider: Optional[str] = None, - logger: Annotated[ - Union[logging.Logger, None, object], - Doc("User specified logger to pass into Context and log service messages."), - ] = logger, + logger: Optional[Union["LoggerProto", logging.Logger]] = logger, ) -> None: self.logger = logger if group_id is None: