Skip to content

Commit eb8d8c1

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): api update (#20)
1 parent e9ffbf7 commit eb8d8c1

21 files changed

+776
-336
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 68
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-b76552205a47dd462bf23820944444a694c1bdaa324f9fa38dde6a83c7a5d8a8.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-8495df8dac8754464d36f9f117ed882c5bc65aeb0bd22e76a2e0cf348f23d941.yml

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ client = Asktable()
8484

8585
try:
8686
client.datasources.create(
87-
access_config={},
8887
engine="mysql",
8988
)
9089
except asktable.APIConnectionError as e:
@@ -130,7 +129,6 @@ client = Asktable(
130129

131130
# Or, configure per-request:
132131
client.with_options(max_retries=5).datasources.create(
133-
access_config={},
134132
engine="mysql",
135133
)
136134
```
@@ -156,7 +154,6 @@ client = Asktable(
156154

157155
# Override per-request:
158156
client.with_options(timeout=5.0).datasources.create(
159-
access_config={},
160157
engine="mysql",
161158
)
162159
```
@@ -198,7 +195,6 @@ from asktable import Asktable
198195

199196
client = Asktable()
200197
response = client.datasources.with_raw_response.create(
201-
access_config={},
202198
engine="mysql",
203199
)
204200
print(response.headers.get('X-My-Header'))
@@ -219,7 +215,6 @@ To stream the response body, use `.with_streaming_response` instead, which requi
219215

220216
```python
221217
with client.datasources.with_streaming_response.create(
222-
access_config={},
223218
engine="mysql",
224219
) as response:
225220
print(response.headers.get("X-My-Header"))

api.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,14 @@ Methods:
139139
Types:
140140

141141
```python
142-
from asktable.types.datasources import Meta, MetaCreateResponse, MetaUpdateResponse
142+
from asktable.types.datasources import MetaCreateResponse, MetaRetrieveResponse, MetaUpdateResponse
143143
```
144144

145145
Methods:
146146

147-
- <code title="post /datasources/{datasource_id}/meta">client.datasources.meta.<a href="./src/asktable/resources/datasources/meta.py">create</a>(datasource_id) -> <a href="./src/asktable/types/datasources/meta_create_response.py">object</a></code>
148-
- <code title="get /datasources/{datasource_id}/meta">client.datasources.meta.<a href="./src/asktable/resources/datasources/meta.py">retrieve</a>(datasource_id, \*\*<a href="src/asktable/types/datasources/meta_retrieve_params.py">params</a>) -> <a href="./src/asktable/types/datasources/meta.py">Meta</a></code>
149-
- <code title="put /datasources/{datasource_id}/meta">client.datasources.meta.<a href="./src/asktable/resources/datasources/meta.py">update</a>(\*, path_datasource_id, \*\*<a href="src/asktable/types/datasources/meta_update_params.py">params</a>) -> <a href="./src/asktable/types/datasources/meta_update_response.py">object</a></code>
147+
- <code title="post /datasources/{datasource_id}/meta">client.datasources.meta.<a href="./src/asktable/resources/datasources/meta.py">create</a>(datasource_id, \*\*<a href="src/asktable/types/datasources/meta_create_params.py">params</a>) -> <a href="./src/asktable/types/datasources/meta_create_response.py">object</a></code>
148+
- <code title="get /datasources/{datasource_id}/meta">client.datasources.meta.<a href="./src/asktable/resources/datasources/meta.py">retrieve</a>(datasource_id) -> <a href="./src/asktable/types/datasources/meta_retrieve_response.py">MetaRetrieveResponse</a></code>
149+
- <code title="put /datasources/{datasource_id}/meta">client.datasources.meta.<a href="./src/asktable/resources/datasources/meta.py">update</a>(datasource_id, \*\*<a href="src/asktable/types/datasources/meta_update_params.py">params</a>) -> <a href="./src/asktable/types/datasources/meta_update_response.py">object</a></code>
150150

151151
## UploadParams
152152

requirements-dev.lock

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ anyio==4.4.0
1616
# via httpx
1717
argcomplete==3.1.2
1818
# via nox
19-
attrs==23.1.0
20-
# via pytest
2119
certifi==2023.7.22
2220
# via httpcore
2321
# via httpx
@@ -28,8 +26,9 @@ distlib==0.3.7
2826
# via virtualenv
2927
distro==1.8.0
3028
# via asktable
31-
exceptiongroup==1.1.3
29+
exceptiongroup==1.2.2
3230
# via anyio
31+
# via pytest
3332
filelock==3.12.4
3433
# via virtualenv
3534
h11==0.14.0
@@ -60,20 +59,18 @@ packaging==23.2
6059
# via pytest
6160
platformdirs==3.11.0
6261
# via virtualenv
63-
pluggy==1.3.0
64-
# via pytest
65-
py==1.11.0
62+
pluggy==1.5.0
6663
# via pytest
67-
pydantic==2.7.1
64+
pydantic==2.9.2
6865
# via asktable
69-
pydantic-core==2.18.2
66+
pydantic-core==2.23.4
7067
# via pydantic
7168
pygments==2.18.0
7269
# via rich
7370
pyright==1.1.380
74-
pytest==7.1.1
71+
pytest==8.3.3
7572
# via pytest-asyncio
76-
pytest-asyncio==0.21.1
73+
pytest-asyncio==0.24.0
7774
python-dateutil==2.8.2
7875
# via time-machine
7976
pytz==2023.3.post1
@@ -90,10 +87,10 @@ sniffio==1.3.0
9087
# via asktable
9188
# via httpx
9289
time-machine==2.9.0
93-
tomli==2.0.1
90+
tomli==2.0.2
9491
# via mypy
9592
# via pytest
96-
typing-extensions==4.8.0
93+
typing-extensions==4.12.2
9794
# via anyio
9895
# via asktable
9996
# via mypy

requirements.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ certifi==2023.7.22
1919
# via httpx
2020
distro==1.8.0
2121
# via asktable
22-
exceptiongroup==1.1.3
22+
exceptiongroup==1.2.2
2323
# via anyio
2424
h11==0.14.0
2525
# via httpcore
@@ -30,15 +30,15 @@ httpx==0.25.2
3030
idna==3.4
3131
# via anyio
3232
# via httpx
33-
pydantic==2.7.1
33+
pydantic==2.9.2
3434
# via asktable
35-
pydantic-core==2.18.2
35+
pydantic-core==2.23.4
3636
# via pydantic
3737
sniffio==1.3.0
3838
# via anyio
3939
# via asktable
4040
# via httpx
41-
typing-extensions==4.8.0
41+
typing-extensions==4.12.2
4242
# via anyio
4343
# via asktable
4444
# via pydantic

src/asktable/_compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str:
133133
def model_dump(
134134
model: pydantic.BaseModel,
135135
*,
136-
exclude: IncEx = None,
136+
exclude: IncEx | None = None,
137137
exclude_unset: bool = False,
138138
exclude_defaults: bool = False,
139139
warnings: bool = True,

src/asktable/_models.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def __str__(self) -> str:
176176
# Based on https://github.com/samuelcolvin/pydantic/issues/1168#issuecomment-817742836.
177177
@classmethod
178178
@override
179-
def construct(
179+
def construct( # pyright: ignore[reportIncompatibleMethodOverride]
180180
cls: Type[ModelT],
181181
_fields_set: set[str] | None = None,
182182
**values: object,
@@ -248,8 +248,8 @@ def model_dump(
248248
self,
249249
*,
250250
mode: Literal["json", "python"] | str = "python",
251-
include: IncEx = None,
252-
exclude: IncEx = None,
251+
include: IncEx | None = None,
252+
exclude: IncEx | None = None,
253253
by_alias: bool = False,
254254
exclude_unset: bool = False,
255255
exclude_defaults: bool = False,
@@ -303,8 +303,8 @@ def model_dump_json(
303303
self,
304304
*,
305305
indent: int | None = None,
306-
include: IncEx = None,
307-
exclude: IncEx = None,
306+
include: IncEx | None = None,
307+
exclude: IncEx | None = None,
308308
by_alias: bool = False,
309309
exclude_unset: bool = False,
310310
exclude_defaults: bool = False,

src/asktable/_types.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
Optional,
1717
Sequence,
1818
)
19-
from typing_extensions import Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable
19+
from typing_extensions import Set, Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable
2020

2121
import httpx
2222
import pydantic
@@ -193,7 +193,9 @@ def get(self, __key: str) -> str | None: ...
193193

194194
# Note: copied from Pydantic
195195
# https://github.com/pydantic/pydantic/blob/32ea570bf96e84234d2992e1ddf40ab8a565925a/pydantic/main.py#L49
196-
IncEx: TypeAlias = "set[int] | set[str] | dict[int, Any] | dict[str, Any] | None"
196+
IncEx: TypeAlias = Union[
197+
Set[int], Set[str], Mapping[int, Union["IncEx", Literal[True]]], Mapping[str, Union["IncEx", Literal[True]]]
198+
]
197199

198200
PostParser = Callable[[Any], Any]
199201

0 commit comments

Comments
 (0)