Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct type signatures according to pyright #259

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/posit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

from . import connect # noqa

__all__ = "connect"
__all__ = [
"connect"
]
5 changes: 0 additions & 5 deletions src/posit/connect/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
1 change: 0 additions & 1 deletion src/posit/connect/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions src/posit/connect/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Comment on lines +38 to +40
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zackverham - this resolves the overload signature issue you encountered.


class Resources(ABC):
def __init__(self, params: ResourceParameters) -> None:
Expand Down
3 changes: 2 additions & 1 deletion src/posit/connect/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def __init__(self, params: ResourceParameters) -> None:
@overload
def find(
self,
*,
prefix: str = ...,
user_role: str = ...,
account_status: str = ...,
Expand All @@ -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()
Expand Down
Loading