Skip to content

Commit daef4df

Browse files
authored
Merge pull request #16 from DataMini/release-please--branches--main--changes--next
release: 3.2.0
2 parents 486839b + 9f8f76e commit daef4df

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2262
-1190
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "3.1.0"
2+
".": "3.2.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 68
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-f8d4f4ee9ccccf65054df0c205156f6022a8d207441b1494fa56bd950b44593b.yml
1+
configured_endpoints: 74
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-2501e64cd24ad589fc833556bbecd5f54321add8f57b18c6af3503a75be0101f.yml

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
# Changelog
22

3+
## 3.2.0 (2024-11-12)
4+
5+
Full Changelog: [v3.1.0...v3.2.0](https://github.com/DataMini/asktable-python/compare/v3.1.0...v3.2.0)
6+
7+
### Features
8+
9+
* **api:** api update ([#15](https://github.com/DataMini/asktable-python/issues/15)) ([0bd4771](https://github.com/DataMini/asktable-python/commit/0bd477131ac8185904589a971e78023c254f88fc))
10+
* **api:** api update ([#17](https://github.com/DataMini/asktable-python/issues/17)) ([6e24354](https://github.com/DataMini/asktable-python/commit/6e24354e23a176d8afccb60c0cc11bb1ebdf33ab))
11+
* **api:** api update ([#18](https://github.com/DataMini/asktable-python/issues/18)) ([8492bb7](https://github.com/DataMini/asktable-python/commit/8492bb7e705d0c60343a272ab7fb5e9cf28d5ecb))
12+
* **api:** api update ([#19](https://github.com/DataMini/asktable-python/issues/19)) ([e9ffbf7](https://github.com/DataMini/asktable-python/commit/e9ffbf7f64390dac45ea2454f06280baab45aa7f))
13+
* **api:** api update ([#20](https://github.com/DataMini/asktable-python/issues/20)) ([eb8d8c1](https://github.com/DataMini/asktable-python/commit/eb8d8c159ec9f6db0cb3400fd28da376a362054f))
14+
* **api:** api update ([#23](https://github.com/DataMini/asktable-python/issues/23)) ([6527b96](https://github.com/DataMini/asktable-python/commit/6527b963f43a6b608283dfaa7f9d90d1140f5fe5))
15+
* **api:** api update ([#24](https://github.com/DataMini/asktable-python/issues/24)) ([83045c6](https://github.com/DataMini/asktable-python/commit/83045c6a90f350182f9c022d74ebb9d3c23f0b59))
16+
* **api:** api update ([#27](https://github.com/DataMini/asktable-python/issues/27)) ([c16037f](https://github.com/DataMini/asktable-python/commit/c16037f8c580a56c5348c82baf04d3f0e1980dff))
17+
* **api:** manual updates ([#28](https://github.com/DataMini/asktable-python/issues/28)) ([a75217e](https://github.com/DataMini/asktable-python/commit/a75217ea3d433687573070480ef7381bd3f2d887))
18+
* **api:** manual updates ([#29](https://github.com/DataMini/asktable-python/issues/29)) ([35884cc](https://github.com/DataMini/asktable-python/commit/35884ccfecaf87c60899ea1a143a8640125d4e8c))
19+
20+
21+
### Chores
22+
23+
* rebuild project due to codegen change ([#21](https://github.com/DataMini/asktable-python/issues/21)) ([911dd76](https://github.com/DataMini/asktable-python/commit/911dd760e7d4022725fcd8607d3c7907d3a7fae3))
24+
* rebuild project due to codegen change ([#22](https://github.com/DataMini/asktable-python/issues/22)) ([9df1755](https://github.com/DataMini/asktable-python/commit/9df175567613a324478980242eee95cacf64a34d))
25+
* rebuild project due to codegen change ([#25](https://github.com/DataMini/asktable-python/issues/25)) ([c5804aa](https://github.com/DataMini/asktable-python/commit/c5804aa3ad70a4470ca30a75460cd12b145fddc4))
26+
* rebuild project due to codegen change ([#26](https://github.com/DataMini/asktable-python/issues/26)) ([6db974f](https://github.com/DataMini/asktable-python/commit/6db974fc42b9933b4ba685d50b08657bdd191747))
27+
328
## 3.1.0 (2024-10-13)
429

530
Full Changelog: [v3.0.0...v3.1.0](https://github.com/DataMini/asktable-python/compare/v3.0.0...v3.1.0)

README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![PyPI version](https://img.shields.io/pypi/v/asktable.svg)](https://pypi.org/project/asktable/)
44

5-
The Asktable Python library provides convenient access to the Asktable REST API from any Python 3.7+
5+
The Asktable Python library provides convenient access to the Asktable REST API from any Python 3.8+
66
application. The library includes type definitions for all request params and response fields,
77
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
88

@@ -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"))
@@ -321,7 +316,7 @@ print(asktable.__version__)
321316

322317
## Requirements
323318

324-
Python 3.7 or higher.
319+
Python 3.8 or higher.
325320

326321
## Contributing
327322

api.md

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ Methods:
9393
Types:
9494

9595
```python
96-
from asktable.types import Chat, ChatOut, ChatListResponse
96+
from asktable.types import ChatCreateResponse, ChatRetrieveResponse, ChatListResponse
9797
```
9898

9999
Methods:
100100

101-
- <code title="post /chats">client.chats.<a href="./src/asktable/resources/chats/chats.py">create</a>(\*\*<a href="src/asktable/types/chat_create_params.py">params</a>) -> <a href="./src/asktable/types/chat.py">Chat</a></code>
102-
- <code title="get /chats/{chat_id}">client.chats.<a href="./src/asktable/resources/chats/chats.py">retrieve</a>(chat_id) -> <a href="./src/asktable/types/chat_out.py">ChatOut</a></code>
101+
- <code title="post /chats">client.chats.<a href="./src/asktable/resources/chats/chats.py">create</a>(\*\*<a href="src/asktable/types/chat_create_params.py">params</a>) -> <a href="./src/asktable/types/chat_create_response.py">ChatCreateResponse</a></code>
102+
- <code title="get /chats/{chat_id}">client.chats.<a href="./src/asktable/resources/chats/chats.py">retrieve</a>(chat_id) -> <a href="./src/asktable/types/chat_retrieve_response.py">ChatRetrieveResponse</a></code>
103103
- <code title="get /chats">client.chats.<a href="./src/asktable/resources/chats/chats.py">list</a>(\*\*<a href="src/asktable/types/chat_list_params.py">params</a>) -> <a href="./src/asktable/types/chat_list_response.py">ChatListResponse</a></code>
104104
- <code title="delete /chats/{chat_id}">client.chats.<a href="./src/asktable/resources/chats/chats.py">delete</a>(chat_id) -> None</code>
105105

@@ -139,14 +139,20 @@ Methods:
139139
Types:
140140

141141
```python
142-
from asktable.types.datasources import Meta, MetaCreateResponse, MetaUpdateResponse
142+
from asktable.types.datasources import (
143+
Meta,
144+
MetaCreateResponse,
145+
MetaUpdateResponse,
146+
MetaDeleteResponse,
147+
)
143148
```
144149

145150
Methods:
146151

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>
152+
- <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>
153+
- <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.py">Meta</a></code>
154+
- <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>
155+
- <code title="delete /datasources/{datasource_id}/meta">client.datasources.meta.<a href="./src/asktable/resources/datasources/meta.py">delete</a>(datasource_id) -> <a href="./src/asktable/types/datasources/meta_delete_response.py">object</a></code>
150156

151157
## UploadParams
152158

@@ -279,7 +285,19 @@ from asktable.types import AnswerDataSourceOut
279285

280286
Methods:
281287

282-
- <code title="post /integration/excel_csv_ask">client.integration.<a href="./src/asktable/resources/integration.py">excel_csv_ask</a>(\*\*<a href="src/asktable/types/integration_excel_csv_ask_params.py">params</a>) -> <a href="./src/asktable/types/answer_data_source_out.py">AnswerDataSourceOut</a></code>
288+
- <code title="post /integration/excel_csv_ask">client.integration.<a href="./src/asktable/resources/integration/integration.py">excel_csv_ask</a>(\*\*<a href="src/asktable/types/integration_excel_csv_ask_params.py">params</a>) -> <a href="./src/asktable/types/answer_data_source_out.py">AnswerDataSourceOut</a></code>
289+
290+
## ExcelCsv
291+
292+
Types:
293+
294+
```python
295+
from asktable.types.integration import DatasourceOut
296+
```
297+
298+
Methods:
299+
300+
- <code title="post /integration/create_excel_ds">client.integration.excel_csv.<a href="./src/asktable/resources/integration/excel_csv.py">create</a>(\*\*<a href="src/asktable/types/integration/excel_csv_create_params.py">params</a>) -> <a href="./src/asktable/types/data_source.py">DataSource</a></code>
283301

284302
# Sys
285303

@@ -324,3 +342,18 @@ from asktable.types.sys.projects import TokenCreateResponse
324342
Methods:
325343

326344
- <code title="post /sys/projects/{project_id}/tokens">client.sys.projects.tokens.<a href="./src/asktable/resources/sys/projects/tokens.py">create</a>(project_id, \*\*<a href="src/asktable/types/sys/projects/token_create_params.py">params</a>) -> <a href="./src/asktable/types/sys/projects/token_create_response.py">object</a></code>
345+
346+
# KB
347+
348+
Types:
349+
350+
```python
351+
from asktable.types import Document, PageDocument, KBCreateResponse, KBDeleteResponse
352+
```
353+
354+
Methods:
355+
356+
- <code title="post /kb">client.kb.<a href="./src/asktable/resources/kb.py">create</a>(\*\*<a href="src/asktable/types/kb_create_params.py">params</a>) -> <a href="./src/asktable/types/kb_create_response.py">KBCreateResponse</a></code>
357+
- <code title="get /kb/{doc_id}">client.kb.<a href="./src/asktable/resources/kb.py">retrieve</a>(doc_id) -> <a href="./src/asktable/types/document.py">Document</a></code>
358+
- <code title="get /kb">client.kb.<a href="./src/asktable/resources/kb.py">list</a>(\*\*<a href="src/asktable/types/kb_list_params.py">params</a>) -> <a href="./src/asktable/types/page_document.py">PageDocument</a></code>
359+
- <code title="delete /kb/{doc_id}">client.kb.<a href="./src/asktable/resources/kb.py">delete</a>(doc_id) -> <a href="./src/asktable/types/kb_delete_response.py">object</a></code>

pyproject.toml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "asktable"
3-
version = "3.1.0"
3+
version = "3.2.0"
44
description = "The official Python library for the asktable API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -16,11 +16,10 @@ dependencies = [
1616
"sniffio",
1717
"cached-property; python_version < '3.8'",
1818
]
19-
requires-python = ">= 3.7"
19+
requires-python = ">= 3.8"
2020
classifiers = [
2121
"Typing :: Typed",
2222
"Intended Audience :: Developers",
23-
"Programming Language :: Python :: 3.7",
2423
"Programming Language :: Python :: 3.8",
2524
"Programming Language :: Python :: 3.9",
2625
"Programming Language :: Python :: 3.10",
@@ -63,11 +62,11 @@ format = { chain = [
6362
"format:ruff",
6463
"format:docs",
6564
"fix:ruff",
65+
# run formatting again to fix any inconsistencies when imports are stripped
66+
"format:ruff",
6667
]}
67-
"format:black" = "black ."
6868
"format:docs" = "python scripts/utils/ruffen-docs.py README.md api.md"
6969
"format:ruff" = "ruff format"
70-
"format:isort" = "isort ."
7170

7271
"lint" = { chain = [
7372
"check:ruff",
@@ -125,10 +124,6 @@ path = "README.md"
125124
pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)'
126125
replacement = '[\1](https://github.com/DataMini/asktable-python/tree/main/\g<2>)'
127126

128-
[tool.black]
129-
line-length = 120
130-
target-version = ["py37"]
131-
132127
[tool.pytest.ini_options]
133128
testpaths = ["tests"]
134129
addopts = "--tb=short"
@@ -143,7 +138,7 @@ filterwarnings = [
143138
# there are a couple of flags that are still disabled by
144139
# default in strict mode as they are experimental and niche.
145140
typeCheckingMode = "strict"
146-
pythonVersion = "3.7"
141+
pythonVersion = "3.8"
147142

148143
exclude = [
149144
"_dev",

requirements-dev.lock

Lines changed: 11 additions & 14 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
@@ -49,7 +48,7 @@ markdown-it-py==3.0.0
4948
# via rich
5049
mdurl==0.1.2
5150
# via markdown-it-py
52-
mypy==1.11.2
51+
mypy==1.13.0
5352
mypy-extensions==1.0.0
5453
# via mypy
5554
nodeenv==1.8.0
@@ -60,27 +59,25 @@ 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
8077
# via dirty-equals
8178
respx==0.20.2
8279
rich==13.7.1
83-
ruff==0.6.5
80+
ruff==0.6.9
8481
setuptools==68.2.2
8582
# via nodeenv
8683
six==1.16.0
@@ -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/_base_client.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ def __init__(
143143
self.url = url
144144
self.params = params
145145

146+
@override
147+
def __repr__(self) -> str:
148+
if self.url:
149+
return f"{self.__class__.__name__}(url={self.url})"
150+
return f"{self.__class__.__name__}(params={self.params})"
151+
146152

147153
class BasePage(GenericModel, Generic[_T]):
148154
"""
@@ -689,7 +695,8 @@ def _calculate_retry_timeout(
689695
if retry_after is not None and 0 < retry_after <= 60:
690696
return retry_after
691697

692-
nb_retries = max_retries - remaining_retries
698+
# Also cap retry count to 1000 to avoid any potential overflows with `pow`
699+
nb_retries = min(max_retries - remaining_retries, 1000)
693700

694701
# Apply exponential backoff, but not more than the max.
695702
sleep_seconds = min(INITIAL_RETRY_DELAY * pow(2.0, nb_retries), MAX_RETRY_DELAY)
@@ -1568,7 +1575,7 @@ async def _request(
15681575
except Exception as err:
15691576
log.debug("Encountered Exception", exc_info=True)
15701577

1571-
if retries_taken > 0:
1578+
if remaining_retries > 0:
15721579
return await self._retry_request(
15731580
input_options,
15741581
cast_to,

0 commit comments

Comments
 (0)