diff --git a/aredis_om/connections.py b/aredis_om/connections.py index 37265a0..a8e693e 100644 --- a/aredis_om/connections.py +++ b/aredis_om/connections.py @@ -7,13 +7,14 @@ URL = os.environ.get("REDIS_OM_URL", None) def get_redis_connection(**kwargs) -> redis.Redis: + # Decode from UTF-8 by default + if "decode_responses" not in kwargs: + kwargs["decode_responses"] = True + # If someone passed in a 'url' parameter, or specified a REDIS_OM_URL # environment variable, we'll create the Redis client from the URL. url = kwargs.pop("url", URL) if url: return redis.Redis.from_url(url, **kwargs) - # Decode from UTF-8 by default - if "decode_responses" not in kwargs: - kwargs["decode_responses"] = True return redis.Redis(**kwargs)