Skip to content

Commit

Permalink
FIx typing error in url module
Browse files Browse the repository at this point in the history
  • Loading branch information
ajparsons committed Nov 13, 2023
1 parent d6eabdb commit 2427f53
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/data_common/helpers/url.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import Any, NamedTuple, Union
from typing import Any, NamedTuple, Union, TypeVar
from urllib.parse import ParseResult, urlparse

from pydantic import GetCoreSchemaHandler
Expand Down Expand Up @@ -35,6 +35,9 @@ def __str__(self):
return ":".join(self)


T = TypeVar("T", bound="UrlHandler")


class UrlHandler:
def __str__(self):
return self._urlparse.geturl()
Expand All @@ -49,7 +52,7 @@ def __init__(
self._netloc = NetLoc.from_parse_result(self._urlparse)

def update(
self,
self: T,
scheme: str = "",
path: str = "",
params: str = "",
Expand All @@ -59,7 +62,7 @@ def update(
port: str = "",
username: str = "",
password: str = "",
) -> Self:
) -> T:
new = self.__class__(self._urlparse.geturl())

if scheme:
Expand Down

0 comments on commit 2427f53

Please sign in to comment.