Skip to content

Commit efd6ca6

Browse files
authored
Merge pull request #184 from DataMini/release-please--branches--main--changes--next
release: 5.3.0
2 parents e66e8a9 + dc51949 commit efd6ca6

Some content is hidden

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

41 files changed

+261
-54
lines changed

.github/workflows/publish-pypi.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ jobs:
2020
run: |
2121
curl -sSf https://rye.astral.sh/get | bash
2222
echo "$HOME/.rye/shims" >> $GITHUB_PATH
23-
/home/runner/.rye/self/bin/python3 -m ensurepip --default-pip
2423
env:
2524
RYE_VERSION: '0.44.0'
2625
RYE_INSTALL_OPTION: '--yes'

.release-please-manifest.json

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

.stats.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
configured_endpoints: 96
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-a5dd7235306810ee00a03bee4d754c8af4852a2513fa575bfa142d0287b12d35.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-5f188889fe648ea83d57911900fe61825d9d7d1446fce966ffca7a9bbe2e3079.yml
3+
openapi_spec_hash: 42af219a138819686969b60410be0cb6
4+
config_hash: 575ddfb316392e5f7f3c7b7999796a03

CHANGELOG.md

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

3+
## 5.3.0 (2025-04-09)
4+
5+
Full Changelog: [v5.2.0...v5.3.0](https://github.com/DataMini/asktable-python/compare/v5.2.0...v5.3.0)
6+
7+
### Features
8+
9+
* **api:** api update ([#187](https://github.com/DataMini/asktable-python/issues/187)) ([645b80a](https://github.com/DataMini/asktable-python/commit/645b80a780d0409c0368ab2ec7d4c811b4bb74ac))
10+
* **api:** api update ([#188](https://github.com/DataMini/asktable-python/issues/188)) ([ebd0446](https://github.com/DataMini/asktable-python/commit/ebd044644cd2bd152456b124e4b356cd08bfdc76))
11+
* **api:** api update ([#190](https://github.com/DataMini/asktable-python/issues/190)) ([fabff6d](https://github.com/DataMini/asktable-python/commit/fabff6d4a56673e1c6b60744e88607fc773abc55))
12+
* **api:** api update ([#191](https://github.com/DataMini/asktable-python/issues/191)) ([0270755](https://github.com/DataMini/asktable-python/commit/0270755b827e9ea9227ce977e026fefaf1189da0))
13+
* **api:** api update ([#192](https://github.com/DataMini/asktable-python/issues/192)) ([d6d57bc](https://github.com/DataMini/asktable-python/commit/d6d57bcf4eb98b8adb76508963ecc6a7ac2aaa01))
14+
* **api:** api update ([#196](https://github.com/DataMini/asktable-python/issues/196)) ([addbcf9](https://github.com/DataMini/asktable-python/commit/addbcf9cdb9d3f6c710ac53f94b529c236eaa5c0))
15+
16+
17+
### Bug Fixes
18+
19+
* **ci:** ensure pip is always available ([#185](https://github.com/DataMini/asktable-python/issues/185)) ([1bf7016](https://github.com/DataMini/asktable-python/commit/1bf701617a81109d6071e06f09910349544cbf6f))
20+
* **ci:** remove publishing patch ([#186](https://github.com/DataMini/asktable-python/issues/186)) ([077f917](https://github.com/DataMini/asktable-python/commit/077f9172189fb51d058fdaf48671d1c74d1c73cf))
21+
22+
23+
### Chores
24+
25+
* fix typos ([#189](https://github.com/DataMini/asktable-python/issues/189)) ([f294618](https://github.com/DataMini/asktable-python/commit/f294618bf32edd5a19f1a357f13e78e4c0fec096))
26+
* **internal:** codegen related update ([#195](https://github.com/DataMini/asktable-python/issues/195)) ([fb83cf4](https://github.com/DataMini/asktable-python/commit/fb83cf4102ccb7da31a7f66419aa937db9338982))
27+
* **internal:** minor test fixes ([#193](https://github.com/DataMini/asktable-python/issues/193)) ([4483c2f](https://github.com/DataMini/asktable-python/commit/4483c2fefd7f57ed9dfaebc62f4b3d5677d282ee))
28+
* **internal:** remove trailing character ([#194](https://github.com/DataMini/asktable-python/issues/194)) ([27b9d4f](https://github.com/DataMini/asktable-python/commit/27b9d4fbd4a9579c98faa74a75fe87a77489e1b2))
29+
* **internal:** slight transform perf improvement ([#197](https://github.com/DataMini/asktable-python/issues/197)) ([1f09d5b](https://github.com/DataMini/asktable-python/commit/1f09d5b9d3e0119efdbed970898899428406fb29))
30+
* remove custom code ([746f693](https://github.com/DataMini/asktable-python/commit/746f6936a501d656086f6342abed4a54ab07be96))
31+
* slight wording improvement in README ([#199](https://github.com/DataMini/asktable-python/issues/199)) ([9424bae](https://github.com/DataMini/asktable-python/commit/9424bae54d01f1f69cf148f7e941e2149b90b905))
32+
* **tests:** improve enum examples ([#198](https://github.com/DataMini/asktable-python/issues/198)) ([133aa56](https://github.com/DataMini/asktable-python/commit/133aa566654b70214d489a66ab929a17edf93918))
33+
334
## 5.2.0 (2025-03-17)
435

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ print(response.chat_role)
155155

156156
## File uploads
157157

158-
Request parameters that correspond to file uploads can be passed as `bytes`, a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.
158+
Request parameters that correspond to file uploads can be passed as `bytes`, or a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.
159159

160160
```python
161161
from pathlib import Path

bin/publish-pypi

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,4 @@
33
set -eux
44
mkdir -p dist
55
rye build --clean
6-
# Patching importlib-metadata version until upstream library version is updated
7-
# https://github.com/pypa/twine/issues/977#issuecomment-2189800841
8-
"$HOME/.rye/self/bin/python3" -m pip install 'importlib-metadata==7.2.1'
96
rye publish --yes --token=$PYPI_TOKEN

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "asktable"
3-
version = "5.2.0"
3+
version = "5.3.0"
44
description = "The official Python library for the Asktable API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -86,7 +86,7 @@ typecheck = { chain = [
8686
"typecheck:mypy" = "mypy ."
8787

8888
[build-system]
89-
requires = ["hatchling", "hatch-fancy-pypi-readme"]
89+
requires = ["hatchling==1.26.3", "hatch-fancy-pypi-readme"]
9090
build-backend = "hatchling.build"
9191

9292
[tool.hatch.build]

src/asktable/_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ def set_pydantic_config(typ: Any, config: pydantic.ConfigDict) -> None:
681681
setattr(typ, "__pydantic_config__", config) # noqa: B010
682682

683683

684-
# our use of subclasssing here causes weirdness for type checkers,
684+
# our use of subclassing here causes weirdness for type checkers,
685685
# so we just pretend that we don't subclass
686686
if TYPE_CHECKING:
687687
GenericModel = BaseModel

src/asktable/_utils/_transform.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def _get_annotated_type(type_: type) -> type | None:
126126
def _maybe_transform_key(key: str, type_: type) -> str:
127127
"""Transform the given `data` based on the annotations provided in `type_`.
128128
129-
Note: this function only looks at `Annotated` types that contain `PropertInfo` metadata.
129+
Note: this function only looks at `Annotated` types that contain `PropertyInfo` metadata.
130130
"""
131131
annotated_type = _get_annotated_type(type_)
132132
if annotated_type is None:
@@ -142,6 +142,10 @@ def _maybe_transform_key(key: str, type_: type) -> str:
142142
return key
143143

144144

145+
def _no_transform_needed(annotation: type) -> bool:
146+
return annotation == float or annotation == int
147+
148+
145149
def _transform_recursive(
146150
data: object,
147151
*,
@@ -184,6 +188,15 @@ def _transform_recursive(
184188
return cast(object, data)
185189

186190
inner_type = extract_type_arg(stripped_type, 0)
191+
if _no_transform_needed(inner_type):
192+
# for some types there is no need to transform anything, so we can get a small
193+
# perf boost from skipping that work.
194+
#
195+
# but we still need to convert to a list to ensure the data is json-serializable
196+
if is_list(data):
197+
return data
198+
return list(data)
199+
187200
return [_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data]
188201

189202
if is_union_type(stripped_type):
@@ -332,6 +345,15 @@ async def _async_transform_recursive(
332345
return cast(object, data)
333346

334347
inner_type = extract_type_arg(stripped_type, 0)
348+
if _no_transform_needed(inner_type):
349+
# for some types there is no need to transform anything, so we can get a small
350+
# perf boost from skipping that work.
351+
#
352+
# but we still need to convert to a list to ensure the data is json-serializable
353+
if is_list(data):
354+
return data
355+
return list(data)
356+
335357
return [await _async_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data]
336358

337359
if is_union_type(stripped_type):

src/asktable/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "asktable"
4-
__version__ = "5.2.0" # x-release-please-version
4+
__version__ = "5.3.0" # x-release-please-version

0 commit comments

Comments
 (0)