Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "3.14.0"
".": "4.0.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 92
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-812fbef9135838630557abadedcc8c593c10d2133388aaea70b9a313fc546941.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-8db0b80dcaf777d02fd5720543576e1484e9dc93db7c1b50a11ee85c215f88b4.yml
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Changelog

## 4.0.0 (2025-01-09)

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

### ⚠ BREAKING CHANGES

* **api:** better support union schemas with common properties ([#116](https://github.com/DataMini/asktable-python/issues/116))

### Features

* **api:** api update ([#117](https://github.com/DataMini/asktable-python/issues/117)) ([08bb9e3](https://github.com/DataMini/asktable-python/commit/08bb9e3eab139c7bdb5b19d0a068080e21dade45))
* **api:** manual updates ([#118](https://github.com/DataMini/asktable-python/issues/118)) ([717bcd7](https://github.com/DataMini/asktable-python/commit/717bcd7ae11017dda379a4f9617f9be0c12f55d1))


### Bug Fixes

* **api:** better support union schemas with common properties ([#116](https://github.com/DataMini/asktable-python/issues/116)) ([dced8d4](https://github.com/DataMini/asktable-python/commit/dced8d4627b4ab2264b1d6786d25ea27abc41f66))


### Chores

* **internal:** codegen related update ([#115](https://github.com/DataMini/asktable-python/issues/115)) ([fbf67b0](https://github.com/DataMini/asktable-python/commit/fbf67b023055838adee929909c610df65027848b))


### Documentation

* fix typos ([#113](https://github.com/DataMini/asktable-python/issues/113)) ([8306d10](https://github.com/DataMini/asktable-python/commit/8306d102df314903bd18f2d8b77c36a7c39f23ec))

## 3.14.0 (2025-01-08)

Full Changelog: [v3.13.0...v3.14.0](https://github.com/DataMini/asktable-python/compare/v3.13.0...v3.14.0)
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ except asktable.APIStatusError as e:
print(e.response)
```

Error codes are as followed:
Error codes are as follows:

| Status Code | Error Type |
| ----------- | -------------------------- |
Expand Down Expand Up @@ -303,8 +303,7 @@ If you need to access undocumented endpoints, params, or response properties, th
#### Undocumented endpoints

To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other
http verbs. Options on the client will be respected (such as retries) will be respected when making this
request.
http verbs. Options on the client will be respected (such as retries) when making this request.

```py
import httpx
Expand Down Expand Up @@ -376,7 +375,7 @@ with Asktable() as client:
This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:

1. Changes that only affect static types, without breaking runtime behavior.
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
3. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
Expand Down
4 changes: 2 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ from asktable.types import (
Meta,
DatasourceRetrieveResponse,
DatasourceDeleteResponse,
DatasourceAddFilesResponse,
DatasourceAddFileResponse,
DatasourceDeleteFileResponse,
)
```
Expand All @@ -162,7 +162,7 @@ Methods:
- <code title="patch /datasources/{datasource_id}">client.datasources.<a href="./src/asktable/resources/datasources/datasources.py">update</a>(datasource_id, \*\*<a href="src/asktable/types/datasource_update_params.py">params</a>) -> <a href="./src/asktable/types/datasource.py">Datasource</a></code>
- <code title="get /datasources">client.datasources.<a href="./src/asktable/resources/datasources/datasources.py">list</a>(\*\*<a href="src/asktable/types/datasource_list_params.py">params</a>) -> <a href="./src/asktable/types/datasource.py">SyncPage[Datasource]</a></code>
- <code title="delete /datasources/{datasource_id}">client.datasources.<a href="./src/asktable/resources/datasources/datasources.py">delete</a>(datasource_id) -> <a href="./src/asktable/types/datasource_delete_response.py">object</a></code>
- <code title="post /datasources/{datasource_id}/files">client.datasources.<a href="./src/asktable/resources/datasources/datasources.py">add_files</a>(datasource_id, \*\*<a href="src/asktable/types/datasource_add_files_params.py">params</a>) -> <a href="./src/asktable/types/datasource_add_files_response.py">object</a></code>
- <code title="post /datasources/{datasource_id}/files">client.datasources.<a href="./src/asktable/resources/datasources/datasources.py">add_file</a>(datasource_id, \*\*<a href="src/asktable/types/datasource_add_file_params.py">params</a>) -> <a href="./src/asktable/types/datasource_add_file_response.py">object</a></code>
- <code title="delete /datasources/{datasource_id}/files/{file_id}">client.datasources.<a href="./src/asktable/resources/datasources/datasources.py">delete_file</a>(file_id, \*, datasource_id) -> <a href="./src/asktable/types/datasource_delete_file_response.py">object</a></code>

## Meta
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "asktable"
version = "3.14.0"
version = "4.0.0"
description = "The official Python library for the asktable API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/asktable/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "asktable"
__version__ = "3.14.0" # x-release-please-version
__version__ = "4.0.0" # x-release-please-version
44 changes: 22 additions & 22 deletions src/asktable/resources/datasources/datasources.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import List, Mapping, Optional, cast
from typing import Mapping, Optional, cast
from typing_extensions import Literal

import httpx
Expand All @@ -19,7 +19,7 @@
datasource_list_params,
datasource_create_params,
datasource_update_params,
datasource_add_files_params,
datasource_add_file_params,
)
from .indexes import (
IndexesResource,
Expand Down Expand Up @@ -347,11 +347,11 @@ def delete(
cast_to=object,
)

def add_files(
def add_file(
self,
datasource_id: str,
*,
files: List[FileTypes],
file: FileTypes,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -373,16 +373,16 @@ def add_files(
"""
if not datasource_id:
raise ValueError(f"Expected a non-empty value for `datasource_id` but received {datasource_id!r}")
body = deepcopy_minimal({"files": files})
extracted_files = extract_files(cast(Mapping[str, object], body), paths=[["files", "<array>"]])
body = deepcopy_minimal({"file": file})
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
# It should be noted that the actual Content-Type header that will be
# sent to the server will contain a `boundary` parameter, e.g.
# multipart/form-data; boundary=---abc--
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
return self._post(
f"/datasources/{datasource_id}/files",
body=maybe_transform(body, datasource_add_files_params.DatasourceAddFilesParams),
files=extracted_files,
body=maybe_transform(body, datasource_add_file_params.DatasourceAddFileParams),
files=files,
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
Expand Down Expand Up @@ -778,11 +778,11 @@ async def delete(
cast_to=object,
)

async def add_files(
async def add_file(
self,
datasource_id: str,
*,
files: List[FileTypes],
file: FileTypes,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -804,16 +804,16 @@ async def add_files(
"""
if not datasource_id:
raise ValueError(f"Expected a non-empty value for `datasource_id` but received {datasource_id!r}")
body = deepcopy_minimal({"files": files})
extracted_files = extract_files(cast(Mapping[str, object], body), paths=[["files", "<array>"]])
body = deepcopy_minimal({"file": file})
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
# It should be noted that the actual Content-Type header that will be
# sent to the server will contain a `boundary` parameter, e.g.
# multipart/form-data; boundary=---abc--
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
return await self._post(
f"/datasources/{datasource_id}/files",
body=await async_maybe_transform(body, datasource_add_files_params.DatasourceAddFilesParams),
files=extracted_files,
body=await async_maybe_transform(body, datasource_add_file_params.DatasourceAddFileParams),
files=files,
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
Expand Down Expand Up @@ -876,8 +876,8 @@ def __init__(self, datasources: DatasourcesResource) -> None:
self.delete = to_raw_response_wrapper(
datasources.delete,
)
self.add_files = to_raw_response_wrapper(
datasources.add_files,
self.add_file = to_raw_response_wrapper(
datasources.add_file,
)
self.delete_file = to_raw_response_wrapper(
datasources.delete_file,
Expand Down Expand Up @@ -915,8 +915,8 @@ def __init__(self, datasources: AsyncDatasourcesResource) -> None:
self.delete = async_to_raw_response_wrapper(
datasources.delete,
)
self.add_files = async_to_raw_response_wrapper(
datasources.add_files,
self.add_file = async_to_raw_response_wrapper(
datasources.add_file,
)
self.delete_file = async_to_raw_response_wrapper(
datasources.delete_file,
Expand Down Expand Up @@ -954,8 +954,8 @@ def __init__(self, datasources: DatasourcesResource) -> None:
self.delete = to_streamed_response_wrapper(
datasources.delete,
)
self.add_files = to_streamed_response_wrapper(
datasources.add_files,
self.add_file = to_streamed_response_wrapper(
datasources.add_file,
)
self.delete_file = to_streamed_response_wrapper(
datasources.delete_file,
Expand Down Expand Up @@ -993,8 +993,8 @@ def __init__(self, datasources: AsyncDatasourcesResource) -> None:
self.delete = async_to_streamed_response_wrapper(
datasources.delete,
)
self.add_files = async_to_streamed_response_wrapper(
datasources.add_files,
self.add_file = async_to_streamed_response_wrapper(
datasources.add_file,
)
self.delete_file = async_to_streamed_response_wrapper(
datasources.delete_file,
Expand Down
Loading
Loading