|
1 | 1 | from __future__ import annotations |
2 | 2 |
|
3 | 3 | import posixpath |
4 | | -from typing import Generator, Literal, Optional, TypedDict, overload |
| 4 | +from typing import Generator, Literal, Optional, TypedDict |
5 | 5 |
|
6 | 6 | from typing_extensions import NotRequired, Required, Unpack |
7 | 7 |
|
@@ -57,8 +57,7 @@ class _FindBy(TypedDict, total=False): |
57 | 57 | hash: NotRequired[Optional[str]] |
58 | 58 | """Package description hash for R packages.""" |
59 | 59 |
|
60 | | - @overload |
61 | | - def find_by(self, **conditions: Unpack[_FindBy]): |
| 60 | + def find_by(self, **conditions: Unpack[_FindBy]): # type: ignore |
62 | 61 | """ |
63 | 62 | Find the first record matching the specified conditions. |
64 | 63 |
|
@@ -86,11 +85,6 @@ def find_by(self, **conditions: Unpack[_FindBy]): |
86 | 85 | Optional[T] |
87 | 86 | The first record matching the specified conditions, or `None` if no such record exists. |
88 | 87 | """ |
89 | | - |
90 | | - @overload |
91 | | - def find_by(self, **conditions): ... |
92 | | - |
93 | | - def find_by(self, **conditions): |
94 | 88 | return super().find_by(**conditions) |
95 | 89 |
|
96 | 90 |
|
@@ -152,16 +146,10 @@ class _Fetch(TypedDict, total=False): |
152 | 146 | version: Required[str] |
153 | 147 | """The package version""" |
154 | 148 |
|
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 |
162 | 150 | # todo - add pagination support to ActiveSequence |
163 | 151 | url = self._ctx.url + self._path |
164 | | - paginator = Paginator(self._ctx.session, url, conditions) |
| 152 | + paginator = Paginator(self._ctx.session, url, dict(**conditions)) |
165 | 153 | for page in paginator.fetch_pages(): |
166 | 154 | results = page.results |
167 | 155 | yield from (self._create_instance("", **result) for result in results) |
@@ -194,8 +182,7 @@ class _FindBy(TypedDict, total=False): |
194 | 182 | app_guid: NotRequired[str] |
195 | 183 | """The unique identifier of the application this package is associated with""" |
196 | 184 |
|
197 | | - @overload |
198 | | - def find_by(self, **conditions: Unpack[_FindBy]) -> "Package | None": |
| 185 | + def find_by(self, **conditions: Unpack[_FindBy]) -> "Package | None": # type: ignore |
199 | 186 | """ |
200 | 187 | Find the first record matching the specified conditions. |
201 | 188 |
|
@@ -223,9 +210,4 @@ def find_by(self, **conditions: Unpack[_FindBy]) -> "Package | None": |
223 | 210 | Optional[Package] |
224 | 211 | The first record matching the specified conditions, or `None` if no such record exists. |
225 | 212 | """ |
226 | | - |
227 | | - @overload |
228 | | - def find_by(self, **conditions) -> "Package | None": ... |
229 | | - |
230 | | - def find_by(self, **conditions) -> "Package | None": |
231 | 213 | return super().find_by(**conditions) |
0 commit comments