From 8b3a929649b07d8c409cb7fbc9067dcc0ece8ec9 Mon Sep 17 00:00:00 2001 From: tdstein Date: Tue, 27 Aug 2024 09:59:25 -0400 Subject: [PATCH] fix: correct type signatures according to pyright --- src/posit/__init__.py | 4 +++- src/posit/connect/client.py | 5 ----- src/posit/connect/groups.py | 1 - src/posit/connect/resources.py | 3 +++ src/posit/connect/users.py | 3 ++- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/posit/__init__.py b/src/posit/__init__.py index e02b4183..d157e2e9 100644 --- a/src/posit/__init__.py +++ b/src/posit/__init__.py @@ -2,4 +2,6 @@ from . import connect # noqa -__all__ = "connect" +__all__ = [ + "connect" +] diff --git a/src/posit/connect/client.py b/src/posit/connect/client.py index 77001891..cd45d132 100644 --- a/src/posit/connect/client.py +++ b/src/posit/connect/client.py @@ -104,11 +104,6 @@ def __init__(self, url: str, api_key: str) -> None: """ ... - @overload - def __init__(self, *args, **kwargs) -> None: - """Initialize a Client instance.""" - ... - def __init__(self, *args, **kwargs) -> None: """Initialize a Client instance. diff --git a/src/posit/connect/groups.py b/src/posit/connect/groups.py index ec4ace30..459b8546 100644 --- a/src/posit/connect/groups.py +++ b/src/posit/connect/groups.py @@ -143,7 +143,6 @@ def find_one(self, **kwargs) -> Group | None: ------- Group | None """ - dict path = "v1/groups" url = self.url + path paginator = Paginator(self.session, url, params=kwargs) diff --git a/src/posit/connect/resources.py b/src/posit/connect/resources.py index 98328379..60e8cbea 100644 --- a/src/posit/connect/resources.py +++ b/src/posit/connect/resources.py @@ -35,6 +35,9 @@ def __init__(self, params: ResourceParameters, **kwargs): def __setattr__(self, name: str, value: Any) -> None: raise AttributeError("cannot set attributes: use update() instead") + def update(self, *args, **kwargs): + super().update(*args, **kwargs) + class Resources(ABC): def __init__(self, params: ResourceParameters) -> None: diff --git a/src/posit/connect/users.py b/src/posit/connect/users.py index 09502715..7ab1e5db 100644 --- a/src/posit/connect/users.py +++ b/src/posit/connect/users.py @@ -185,6 +185,7 @@ def __init__(self, params: ResourceParameters) -> None: @overload def find( self, + *, prefix: str = ..., user_role: str = ..., account_status: str = ..., @@ -193,7 +194,7 @@ def find( @overload def find(self, **kwargs) -> List[User]: ... - def find(self, **kwargs): + def find(self, **kwargs) -> List[User]: url = self.params.url + "v1/users" paginator = Paginator(self.session, url, params=kwargs) results = paginator.fetch_results()