Skip to content

Commit 9d9d948

Browse files
committed
adds type: ignore for now
1 parent 0c9f372 commit 9d9d948

File tree

3 files changed

+8
-26
lines changed

3 files changed

+8
-26
lines changed

src/posit/connect/packages.py

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
import posixpath
4-
from typing import Generator, Literal, Optional, TypedDict, overload
4+
from typing import Generator, Literal, Optional, TypedDict
55

66
from typing_extensions import NotRequired, Required, Unpack
77

@@ -57,8 +57,7 @@ class _FindBy(TypedDict, total=False):
5757
hash: NotRequired[Optional[str]]
5858
"""Package description hash for R packages."""
5959

60-
@overload
61-
def find_by(self, **conditions: Unpack[_FindBy]):
60+
def find_by(self, **conditions: Unpack[_FindBy]): # type: ignore
6261
"""
6362
Find the first record matching the specified conditions.
6463
@@ -86,11 +85,6 @@ def find_by(self, **conditions: Unpack[_FindBy]):
8685
Optional[T]
8786
The first record matching the specified conditions, or `None` if no such record exists.
8887
"""
89-
90-
@overload
91-
def find_by(self, **conditions): ...
92-
93-
def find_by(self, **conditions):
9488
return super().find_by(**conditions)
9589

9690

@@ -152,16 +146,10 @@ class _Fetch(TypedDict, total=False):
152146
version: Required[str]
153147
"""The package version"""
154148

155-
@overload
156-
def fetch(self, **conditions: Unpack[_Fetch]): ...
157-
158-
@overload
159-
def fetch(self, **conditions): ...
160-
161-
def fetch(self, **conditions) -> Generator["Package"]:
149+
def fetch(self, **conditions: Unpack[_Fetch]) -> Generator["Package"]: # type: ignore
162150
# todo - add pagination support to ActiveSequence
163151
url = self._ctx.url + self._path
164-
paginator = Paginator(self._ctx.session, url, conditions)
152+
paginator = Paginator(self._ctx.session, url, dict(**conditions))
165153
for page in paginator.fetch_pages():
166154
results = page.results
167155
yield from (self._create_instance("", **result) for result in results)
@@ -194,8 +182,7 @@ class _FindBy(TypedDict, total=False):
194182
app_guid: NotRequired[str]
195183
"""The unique identifier of the application this package is associated with"""
196184

197-
@overload
198-
def find_by(self, **conditions: Unpack[_FindBy]) -> "Package | None":
185+
def find_by(self, **conditions: Unpack[_FindBy]) -> "Package | None": # type: ignore
199186
"""
200187
Find the first record matching the specified conditions.
201188
@@ -223,9 +210,4 @@ def find_by(self, **conditions: Unpack[_FindBy]) -> "Package | None":
223210
Optional[Package]
224211
The first record matching the specified conditions, or `None` if no such record exists.
225212
"""
226-
227-
@overload
228-
def find_by(self, **conditions) -> "Package | None": ...
229-
230-
def find_by(self, **conditions) -> "Package | None":
231213
return super().find_by(**conditions)

src/posit/connect/paginator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
from dataclasses import dataclass
4-
from typing import TYPE_CHECKING, Any, Generator, List
4+
from typing import TYPE_CHECKING, Generator, List
55

66
if TYPE_CHECKING:
77
import requests
@@ -45,7 +45,7 @@ def __init__(
4545
self,
4646
session: requests.Session,
4747
url: str,
48-
params: dict[str, Any] | None = None,
48+
params: dict | None = None,
4949
) -> None:
5050
if params is None:
5151
params = {}

src/posit/connect/resources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def _create_instance(self, path: str, /, **kwargs: Any) -> T:
120120
"""Create an instance of 'T'."""
121121
raise NotImplementedError()
122122

123-
def fetch(self, **conditions) -> Iterable[T]:
123+
def fetch(self, **conditions: Any) -> Iterable[T]:
124124
"""Fetch the collection.
125125
126126
Fetches the collection directly from Connect. This operation does not effect the cache state.

0 commit comments

Comments
 (0)