MCPcopy
hub / github.com/redis/redis-py / get_legacy_responses

Function get_legacy_responses

tests/conftest.py:842–852  ·  view source on GitHub ↗

Return the ``legacy_responses`` setting on the client. Defaults to ``True`` (matching the client constructor) when absent from ``connection_kwargs``.

(r)

Source from the content-addressed store, hash-verified

840
841
842def get_legacy_responses(r):
843 """Return the ``legacy_responses`` setting on the client.
844
845 Defaults to ``True`` (matching the client constructor) when absent
846 from ``connection_kwargs``.
847 """
848 if isinstance(r, redis.Redis) or isinstance(r, redis.asyncio.Redis):
849 return r.connection_pool.connection_kwargs.get("legacy_responses", True)
850 elif isinstance(r, redis.cluster.AbstractRedisCluster):
851 return r.nodes_manager.connection_kwargs.get("legacy_responses", True)
852 return True
853
854
855def expected_response_shape(r):

Callers 1

expected_response_shapeFunction · 0.70

Calls 1

getMethod · 0.45

Tested by

no test coverage detected