Skip to content

Commit 54ac152

Browse files
chore: regenerate client from OpenAPI spec
1 parent c178f7b commit 54ac152

8 files changed

Lines changed: 185 additions & 10 deletions

File tree

.openapi-generator/FILES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ docs/RefreshResponse.md
9898
docs/RefreshWarning.md
9999
docs/ResultInfo.md
100100
docs/ResultsApi.md
101+
docs/ResultsFormatQuery.md
101102
docs/Sandbox.md
102103
docs/SandboxResponse.md
103104
docs/SandboxesApi.md
@@ -247,6 +248,7 @@ hotdata/models/refresh_request.py
247248
hotdata/models/refresh_response.py
248249
hotdata/models/refresh_warning.py
249250
hotdata/models/result_info.py
251+
hotdata/models/results_format_query.py
250252
hotdata/models/sandbox.py
251253
hotdata/models/sandbox_response.py
252254
hotdata/models/saved_query_dataset_source.py
@@ -287,4 +289,5 @@ requirements.txt
287289
setup.cfg
288290
test-requirements.txt
289291
test/__init__.py
292+
test/test_results_format_query.py
290293
tox.ini

docs/ResultsApi.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,23 @@ Method | HTTP request | Description
99

1010

1111
# **get_result**
12-
> GetResultResponse get_result(id)
12+
> GetResultResponse get_result(id, offset=offset, limit=limit, format=format)
1313
1414
Get result
1515

16-
Retrieve a persisted query result by ID. If the result is still being processed, only the status is returned. Once ready, the full column and row data is included in the response.
16+
Retrieve a persisted query result by ID. The response format for the `ready` state is selected by `Accept` header or `?format=` query param; non-ready states use the same status codes and JSON body shape regardless of format.
17+
18+
| Result status | Status × body |
19+
|-----------------------|------------------------------------------------------------------------------|
20+
| `ready` + JSON | 200 `application/json``GetResultResponse` with `columns`, `rows`, etc. |
21+
| `ready` + Arrow | 200 `application/vnd.apache.arrow.stream` — schema, RecordBatches, EOS |
22+
| `pending`/`processing`| 202 `application/json` `{status, result_id}` + `Retry-After` |
23+
| `failed` | 409 `application/json` `{status, result_id, error_message}` |
24+
| not found | 404 `application/json` (`ApiErrorResponse`) |
25+
26+
`?format=arrow` (or `?format=json`) takes precedence over `Accept`. Use `?offset=N&limit=M` to slice the result; `offset` defaults to 0 and `limit` is unbounded by default. Both must be non-negative; invalid values return 400. When a finite `limit` doesn't reach the end of the result, a `Link` header with `rel="next"` points at the following page.
27+
28+
Ready responses (both formats) carry `X-Total-Row-Count` (full result row count from parquet metadata, independent of offset/limit). The Arrow path streams end-to-end with no spawned task between the parquet reader and the wire — clients can disconnect at any time and the server stops reading.
1729

1830
### Example
1931

@@ -24,6 +36,7 @@ Retrieve a persisted query result by ID. If the result is still being processed,
2436
```python
2537
import hotdata
2638
from hotdata.models.get_result_response import GetResultResponse
39+
from hotdata.models.results_format_query import ResultsFormatQuery
2740
from hotdata.rest import ApiException
2841
from pprint import pprint
2942

@@ -60,10 +73,13 @@ with hotdata.ApiClient(configuration) as api_client:
6073
# Create an instance of the API class
6174
api_instance = hotdata.ResultsApi(api_client)
6275
id = 'id_example' # str | Result ID
76+
offset = 56 # int | Rows to skip (default: 0) (optional)
77+
limit = 56 # int | Maximum rows to return (default: unbounded) (optional)
78+
format = hotdata.ResultsFormatQuery() # ResultsFormatQuery | `arrow` or `json` — overrides the `Accept` header. (optional)
6379

6480
try:
6581
# Get result
66-
api_response = api_instance.get_result(id)
82+
api_response = api_instance.get_result(id, offset=offset, limit=limit, format=format)
6783
print("The response of ResultsApi->get_result:\n")
6884
pprint(api_response)
6985
except Exception as e:
@@ -78,6 +94,9 @@ with hotdata.ApiClient(configuration) as api_client:
7894
Name | Type | Description | Notes
7995
------------- | ------------- | ------------- | -------------
8096
**id** | **str**| Result ID |
97+
**offset** | **int**| Rows to skip (default: 0) | [optional]
98+
**limit** | **int**| Maximum rows to return (default: unbounded) | [optional]
99+
**format** | [**ResultsFormatQuery**](.md)| `arrow` or `json` — overrides the `Accept` header. | [optional]
81100

82101
### Return type
83102

@@ -90,14 +109,17 @@ Name | Type | Description | Notes
90109
### HTTP request headers
91110

92111
- **Content-Type**: Not defined
93-
- **Accept**: application/json
112+
- **Accept**: application/json, application/vnd.apache.arrow.stream
94113

95114
### HTTP response details
96115

97116
| Status code | Description | Response headers |
98117
|-------------|-------------|------------------|
99-
**200** | Result data | - |
100-
**404** | Result not found | - |
118+
**200** | Result data. JSON callers receive &#x60;GetResultResponse&#x60;. Arrow callers receive an Arrow IPC stream — a sequence of IPC messages: schema header, then RecordBatch messages, then EOS. | * Link - RFC 5988 &#x60;Link&#x60; header with &#x60;rel&#x3D;\&quot;next\&quot;&#x60; pointing at the next page when a finite &#x60;limit&#x60; does not reach the end of the result. <br> * X-Total-Row-Count - Total rows in the full result, ignoring offset/limit. Present only when status is &#x60;ready&#x60;. <br> |
119+
**202** | Result is still being computed (&#x60;pending&#x60; or &#x60;processing&#x60;). Poll the same URL. | * Retry-After - Suggested seconds before the next poll. <br> |
120+
**400** | Invalid offset, limit, or format. | - |
121+
**404** | Result not found. | - |
122+
**409** | Result computation failed. Body carries &#x60;error_message&#x60; describing the failure. | - |
101123

102124
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
103125

docs/ResultsFormatQuery.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# ResultsFormatQuery
2+
3+
Schema for the `?format=` query parameter on `GET /v1/results/{id}`. Documents the canonical values accepted (`arrow`, `json`). The handler's negotiator (`negotiate_results_format`) is intentionally permissive — case-insensitive, with unknown values falling through to the `Accept` header — so this enum only declares the spec-level contract for clients and SDK generators.
4+
5+
## Enum
6+
7+
* `ARROW` (value: `'arrow'`)
8+
9+
* `JSON` (value: `'json'`)
10+
11+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
12+
13+

hotdata/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@
136136
"RefreshResponse",
137137
"RefreshWarning",
138138
"ResultInfo",
139+
"ResultsFormatQuery",
139140
"Sandbox",
140141
"SandboxResponse",
141142
"SavedQueryDatasetSource",
@@ -288,6 +289,7 @@
288289
from hotdata.models.refresh_response import RefreshResponse as RefreshResponse
289290
from hotdata.models.refresh_warning import RefreshWarning as RefreshWarning
290291
from hotdata.models.result_info import ResultInfo as ResultInfo
292+
from hotdata.models.results_format_query import ResultsFormatQuery as ResultsFormatQuery
291293
from hotdata.models.sandbox import Sandbox as Sandbox
292294
from hotdata.models.sandbox_response import SandboxResponse as SandboxResponse
293295
from hotdata.models.saved_query_dataset_source import SavedQueryDatasetSource as SavedQueryDatasetSource

0 commit comments

Comments
 (0)