File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
sentry_sdk/integrations/redis Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -36,14 +36,18 @@ def _set_async_cluster_db_data(span, async_redis_cluster_instance):
3636def _set_async_cluster_pipeline_db_data (span , async_redis_cluster_pipeline_instance ):
3737 # type: (Span, AsyncClusterPipeline[Any]) -> None
3838 with capture_internal_exceptions ():
39- client = (
40- getattr (async_redis_cluster_pipeline_instance , "cluster_client" , None )
41- or async_redis_cluster_pipeline_instance ._client
42- ) # type: AsyncRedisCluster[Any]
39+ client = getattr (async_redis_cluster_pipeline_instance , "cluster_client" , None )
40+ if client is None :
41+ # In older redis-py versions, the AsyncClusterPipeline had a `_client`
42+ # attr but it is private so potentially problematic and mypy does not
43+ # recognize it - see
44+ # https://github.com/redis/redis-py/blame/v5.0.0/redis/asyncio/cluster.py#L1386
45+ client = (
46+ async_redis_cluster_pipeline_instance ._client
47+ ) # type:ignore[attr-defined]
48+
4349 _set_async_cluster_db_data (
4450 span ,
45- # the AsyncClusterPipeline has always had a `_client` attr but it is private so potentially problematic and mypy
46- # does not recognize it - see https://github.com/redis/redis-py/blame/v5.0.0/redis/asyncio/cluster.py#L1386
4751 client ,
4852 )
4953
You can’t perform that action at this time.
0 commit comments