Skip to content

Commit ed923de

Browse files
committed
mypy
1 parent f30f9e3 commit ed923de

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sentry_sdk/integrations/redis/redis_cluster.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,15 @@ def _set_async_cluster_db_data(span, async_redis_cluster_instance):
3636
def _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 = getattr(
40-
async_redis_cluster_pipeline_instance, "cluster_client", None
41-
) or getattr(async_redis_cluster_pipeline_instance, "_client", None)
39+
client = (
40+
getattr(async_redis_cluster_pipeline_instance, "cluster_client", None)
41+
or async_redis_cluster_pipeline_instance._client
42+
) # type: AsyncRedisCluster[Any]
4243
_set_async_cluster_db_data(
4344
span,
4445
# the AsyncClusterPipeline has always had a `_client` attr but it is private so potentially problematic and mypy
4546
# does not recognize it - see https://github.com/redis/redis-py/blame/v5.0.0/redis/asyncio/cluster.py#L1386
46-
client, # type: ignore[attr-defined]
47+
client,
4748
)
4849

4950

0 commit comments

Comments
 (0)