Skip to content

Commit ffbf632

Browse files
authored
Merge pull request #32 from DataMini/release-please--branches--main--changes--next
release: 3.3.0
2 parents daef4df + bc62a03 commit ffbf632

File tree

144 files changed

+4747
-4372
lines changed

Some content is hidden

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

144 files changed

+4747
-4372
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.2.0"
2+
".": "3.3.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: 74
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-2501e64cd24ad589fc833556bbecd5f54321add8f57b18c6af3503a75be0101f.yml
1+
configured_endpoints: 81
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-f78191153cae54be3e273ca76fbb91453dec4696f00fc6d679ca2ffc3d533ede.yml

CHANGELOG.md

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

3+
## 3.3.0 (2024-11-24)
4+
5+
Full Changelog: [v3.2.0...v3.3.0](https://github.com/DataMini/asktable-python/compare/v3.2.0...v3.3.0)
6+
7+
### Features
8+
9+
* **api:** api update ([#31](https://github.com/DataMini/asktable-python/issues/31)) ([268e767](https://github.com/DataMini/asktable-python/commit/268e7672c52e944ce5b86bfb463417ae469b8d03))
10+
* **api:** api update ([#33](https://github.com/DataMini/asktable-python/issues/33)) ([5a4660f](https://github.com/DataMini/asktable-python/commit/5a4660f423deb1ec5edf2a30d44153e00e0771be))
11+
* **api:** api update ([#34](https://github.com/DataMini/asktable-python/issues/34)) ([5db3b77](https://github.com/DataMini/asktable-python/commit/5db3b773117673385135f57c382531417ad72704))
12+
* **api:** api update ([#35](https://github.com/DataMini/asktable-python/issues/35)) ([3d90aa2](https://github.com/DataMini/asktable-python/commit/3d90aa24c6b9312433627ded99833dae3fac32d7))
13+
* **api:** api update ([#36](https://github.com/DataMini/asktable-python/issues/36)) ([9433649](https://github.com/DataMini/asktable-python/commit/943364966023a54ae6a022a8da5b818f0617e3ee))
14+
* **api:** api update ([#39](https://github.com/DataMini/asktable-python/issues/39)) ([0e888dd](https://github.com/DataMini/asktable-python/commit/0e888dd2fcc907d7bb48d7a8cdcf0054063b2f28))
15+
* **api:** api update ([#40](https://github.com/DataMini/asktable-python/issues/40)) ([7d4f6fb](https://github.com/DataMini/asktable-python/commit/7d4f6fbc4ffa228a0a3a9faa2cda71c73cb6aa67))
16+
* **api:** api update ([#41](https://github.com/DataMini/asktable-python/issues/41)) ([95f8c27](https://github.com/DataMini/asktable-python/commit/95f8c270621f46c785261b7ef2356aa326b11905))
17+
* **api:** api update ([#42](https://github.com/DataMini/asktable-python/issues/42)) ([1e6ad9f](https://github.com/DataMini/asktable-python/commit/1e6ad9fa9fee86eb869a88a6a7457b10a321b1dd))
18+
* **api:** manual updates ([#43](https://github.com/DataMini/asktable-python/issues/43)) ([f58065b](https://github.com/DataMini/asktable-python/commit/f58065b10b0af77e5761d0e7bfc6120a5a33ab9b))
19+
* **api:** manual updates ([#44](https://github.com/DataMini/asktable-python/issues/44)) ([8e6183c](https://github.com/DataMini/asktable-python/commit/8e6183c1d338f7a2fe0179f190503ee0fdc520d1))
20+
21+
22+
### Chores
23+
24+
* rebuild project due to codegen change ([#37](https://github.com/DataMini/asktable-python/issues/37)) ([3da94d2](https://github.com/DataMini/asktable-python/commit/3da94d2c69fc812bec6b5ef0dc5f934ba58e706e))
25+
* rebuild project due to codegen change ([#38](https://github.com/DataMini/asktable-python/issues/38)) ([34b494d](https://github.com/DataMini/asktable-python/commit/34b494d2398512da5a44cc6ae6e13a54d324247c))
26+
327
## 3.2.0 (2024-11-12)
428

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

README.md

Lines changed: 71 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ from asktable import Asktable
2828

2929
client = Asktable()
3030

31-
datasource = client.datasources.list()
32-
print(datasource.items)
31+
datasource = client.datasources.create(
32+
engine="mysql",
33+
)
34+
print(datasource.id)
3335
```
3436

3537
While you can provide an `api_key` keyword argument,
@@ -49,8 +51,10 @@ client = AsyncAsktable()
4951

5052

5153
async def main() -> None:
52-
datasource = await client.datasources.list()
53-
print(datasource.items)
54+
datasource = await client.datasources.create(
55+
engine="mysql",
56+
)
57+
print(datasource.id)
5458

5559

5660
asyncio.run(main())
@@ -67,6 +71,69 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
6771

6872
Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
6973

74+
## Pagination
75+
76+
List methods in the Asktable API are paginated.
77+
78+
This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:
79+
80+
```python
81+
from asktable import Asktable
82+
83+
client = Asktable()
84+
85+
all_datasources = []
86+
# Automatically fetches more pages as needed.
87+
for datasource in client.datasources.list():
88+
# Do something with datasource here
89+
all_datasources.append(datasource)
90+
print(all_datasources)
91+
```
92+
93+
Or, asynchronously:
94+
95+
```python
96+
import asyncio
97+
from asktable import AsyncAsktable
98+
99+
client = AsyncAsktable()
100+
101+
102+
async def main() -> None:
103+
all_datasources = []
104+
# Iterate through items across all pages, issuing requests as needed.
105+
async for datasource in client.datasources.list():
106+
all_datasources.append(datasource)
107+
print(all_datasources)
108+
109+
110+
asyncio.run(main())
111+
```
112+
113+
Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:
114+
115+
```python
116+
first_page = await client.datasources.list()
117+
if first_page.has_next_page():
118+
print(f"will fetch next page using these details: {first_page.next_page_info()}")
119+
next_page = await first_page.get_next_page()
120+
print(f"number of items we just fetched: {len(next_page.items)}")
121+
122+
# Remove `await` for non-async usage.
123+
```
124+
125+
Or just work directly with the returned data:
126+
127+
```python
128+
first_page = await client.datasources.list()
129+
130+
print(f"page number: {first_page.page}") # => "page number: 1"
131+
for datasource in first_page.items:
132+
print(datasource.id)
133+
134+
# Remove `await` for non-async usage.
135+
```
136+
70137
## Handling errors
71138

72139
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `asktable.APIConnectionError` is raised.

0 commit comments

Comments
 (0)