From 40989c2c333e08ceff615c7a87a66dad8ae2055e Mon Sep 17 00:00:00 2001 From: ahmedsobeh Date: Fri, 28 Jun 2024 16:44:40 +0200 Subject: [PATCH] created url_parser and removed duplication Signed-off-by: ahmedsobeh --- valkey/_parsers/url_parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/valkey/_parsers/url_parser.py b/valkey/_parsers/url_parser.py index a8138f1b..f77a2730 100644 --- a/valkey/_parsers/url_parser.py +++ b/valkey/_parsers/url_parser.py @@ -1,4 +1,3 @@ -from valkey.asyncio.connection import ConnectKwargs, UnixDomainSocketConnection, SSLConnection from urllib.parse import ParseResult, parse_qs, unquote, urlparse from types import MappingProxyType from typing import ( @@ -34,6 +33,8 @@ def to_bool(value) -> Optional[bool]: def parse_url(url: str) -> ConnectKwargs: + from valkey.asyncio.connection import ConnectKwargs, UnixDomainSocketConnection, SSLConnection + parsed: ParseResult = urlparse(url) kwargs: ConnectKwargs = {}