1111if TYPE_CHECKING :
1212 from collections .abc import Callable
1313
14- from apify_client ._resource_clients .base import BaseBaseClient
14+ from apify_client ._resource_clients .base import BaseClient , BaseCollectionClient
15+
16+ _BaseClient = BaseClient | BaseCollectionClient
1517
1618
1719logger_name = __name__ .split ('.' )[0 ]
@@ -111,7 +113,7 @@ def _injects_client_details_to_log_context(fun: Callable) -> Callable:
111113 if inspect .iscoroutinefunction (fun ):
112114
113115 @functools .wraps (fun )
114- async def async_wrapper (resource_client : BaseBaseClient , * args : Any , ** kwargs : Any ) -> Any :
116+ async def async_wrapper (resource_client : _BaseClient , * args : Any , ** kwargs : Any ) -> Any :
115117 log_context .client_method .set (fun .__qualname__ ) # ty: ignore[unresolved-attribute]
116118 log_context .resource_id .set (resource_client .resource_id )
117119
@@ -122,7 +124,7 @@ async def async_wrapper(resource_client: BaseBaseClient, *args: Any, **kwargs: A
122124 if inspect .isasyncgenfunction (fun ):
123125
124126 @functools .wraps (fun )
125- async def async_generator_wrapper (resource_client : BaseBaseClient , * args : Any , ** kwargs : Any ) -> Any :
127+ async def async_generator_wrapper (resource_client : _BaseClient , * args : Any , ** kwargs : Any ) -> Any :
126128 log_context .client_method .set (fun .__qualname__ ) # ty: ignore[unresolved-attribute]
127129 log_context .resource_id .set (resource_client .resource_id )
128130
@@ -132,7 +134,7 @@ async def async_generator_wrapper(resource_client: BaseBaseClient, *args: Any, *
132134 return async_generator_wrapper
133135
134136 @functools .wraps (fun )
135- def wrapper (resource_client : BaseBaseClient , * args : Any , ** kwargs : Any ) -> Any :
137+ def wrapper (resource_client : _BaseClient , * args : Any , ** kwargs : Any ) -> Any :
136138 log_context .client_method .set (fun .__qualname__ ) # ty: ignore[unresolved-attribute]
137139 log_context .resource_id .set (resource_client .resource_id )
138140
0 commit comments