Skip to content

Commit 91fba8c

Browse files
chore: regenerate client from OpenAPI spec
1 parent c178f7b commit 91fba8c

2 files changed

Lines changed: 92 additions & 10 deletions

File tree

docs/ResultsApi.md

Lines changed: 27 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

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

6479
try:
6580
# Get result
66-
api_response = api_instance.get_result(id)
81+
api_response = api_instance.get_result(id, offset=offset, limit=limit, format=format)
6782
print("The response of ResultsApi->get_result:\n")
6883
pprint(api_response)
6984
except Exception as e:
@@ -78,6 +93,9 @@ with hotdata.ApiClient(configuration) as api_client:
7893
Name | Type | Description | Notes
7994
------------- | ------------- | ------------- | -------------
8095
**id** | **str**| Result ID |
96+
**offset** | **int**| Rows to skip (default: 0) | [optional]
97+
**limit** | **int**| Maximum rows to return (default: unbounded) | [optional]
98+
**format** | **str**| `arrow` or `json` — overrides the `Accept` header. | [optional]
8199

82100
### Return type
83101

@@ -90,14 +108,17 @@ Name | Type | Description | Notes
90108
### HTTP request headers
91109

92110
- **Content-Type**: Not defined
93-
- **Accept**: application/json
111+
- **Accept**: application/json, application/vnd.apache.arrow.stream
94112

95113
### HTTP response details
96114

97115
| Status code | Description | Response headers |
98116
|-------------|-------------|------------------|
99-
**200** | Result data | - |
100-
**404** | Result not found | - |
117+
**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> |
118+
**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> |
119+
**400** | Invalid offset, limit, or format. | - |
120+
**404** | Result not found. | - |
121+
**409** | Result computation failed. Body carries &#x60;error_message&#x60; describing the failure. | - |
101122

102123
[[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)
103124

hotdata/api/results_api.py

Lines changed: 65 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ def __init__(self, api_client=None) -> None:
4444
def get_result(
4545
self,
4646
id: Annotated[StrictStr, Field(description="Result ID")],
47+
offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Rows to skip (default: 0)")] = None,
48+
limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Maximum rows to return (default: unbounded)")] = None,
49+
format: Annotated[Optional[StrictStr], Field(description="`arrow` or `json` — overrides the `Accept` header.")] = None,
4750
_request_timeout: Union[
4851
None,
4952
Annotated[StrictFloat, Field(gt=0)],
@@ -59,10 +62,16 @@ def get_result(
5962
) -> GetResultResponse:
6063
"""Get result
6164
62-
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.
65+
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. | Result status | Status × body | |-----------------------|------------------------------------------------------------------------------| | `ready` + JSON | 200 `application/json` — `GetResultResponse` with `columns`, `rows`, etc. | | `ready` + Arrow | 200 `application/vnd.apache.arrow.stream` — schema, RecordBatches, EOS | | `pending`/`processing`| 202 `application/json` `{status, result_id}` + `Retry-After` | | `failed` | 409 `application/json` `{status, result_id, error_message}` | | not found | 404 `application/json` (`ApiErrorResponse`) | `?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. 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.
6366
6467
:param id: Result ID (required)
6568
:type id: str
69+
:param offset: Rows to skip (default: 0)
70+
:type offset: int
71+
:param limit: Maximum rows to return (default: unbounded)
72+
:type limit: int
73+
:param format: `arrow` or `json` — overrides the `Accept` header.
74+
:type format: str
6675
:param _request_timeout: timeout setting for this request. If one
6776
number provided, it will be total request
6877
timeout. It can also be a pair (tuple) of
@@ -87,6 +96,9 @@ def get_result(
8796

8897
_param = self._get_result_serialize(
8998
id=id,
99+
offset=offset,
100+
limit=limit,
101+
format=format,
90102
_request_auth=_request_auth,
91103
_content_type=_content_type,
92104
_headers=_headers,
@@ -95,7 +107,10 @@ def get_result(
95107

96108
_response_types_map: Dict[str, Optional[str]] = {
97109
'200': "GetResultResponse",
110+
'202': "GetResultResponse",
111+
'400': "ApiErrorResponse",
98112
'404': "ApiErrorResponse",
113+
'409': "GetResultResponse",
99114
}
100115
response_data = self.api_client.call_api(
101116
*_param,
@@ -112,6 +127,9 @@ def get_result(
112127
def get_result_with_http_info(
113128
self,
114129
id: Annotated[StrictStr, Field(description="Result ID")],
130+
offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Rows to skip (default: 0)")] = None,
131+
limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Maximum rows to return (default: unbounded)")] = None,
132+
format: Annotated[Optional[StrictStr], Field(description="`arrow` or `json` — overrides the `Accept` header.")] = None,
115133
_request_timeout: Union[
116134
None,
117135
Annotated[StrictFloat, Field(gt=0)],
@@ -127,10 +145,16 @@ def get_result_with_http_info(
127145
) -> ApiResponse[GetResultResponse]:
128146
"""Get result
129147
130-
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.
148+
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. | Result status | Status × body | |-----------------------|------------------------------------------------------------------------------| | `ready` + JSON | 200 `application/json` — `GetResultResponse` with `columns`, `rows`, etc. | | `ready` + Arrow | 200 `application/vnd.apache.arrow.stream` — schema, RecordBatches, EOS | | `pending`/`processing`| 202 `application/json` `{status, result_id}` + `Retry-After` | | `failed` | 409 `application/json` `{status, result_id, error_message}` | | not found | 404 `application/json` (`ApiErrorResponse`) | `?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. 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.
131149
132150
:param id: Result ID (required)
133151
:type id: str
152+
:param offset: Rows to skip (default: 0)
153+
:type offset: int
154+
:param limit: Maximum rows to return (default: unbounded)
155+
:type limit: int
156+
:param format: `arrow` or `json` — overrides the `Accept` header.
157+
:type format: str
134158
:param _request_timeout: timeout setting for this request. If one
135159
number provided, it will be total request
136160
timeout. It can also be a pair (tuple) of
@@ -155,6 +179,9 @@ def get_result_with_http_info(
155179

156180
_param = self._get_result_serialize(
157181
id=id,
182+
offset=offset,
183+
limit=limit,
184+
format=format,
158185
_request_auth=_request_auth,
159186
_content_type=_content_type,
160187
_headers=_headers,
@@ -163,7 +190,10 @@ def get_result_with_http_info(
163190

164191
_response_types_map: Dict[str, Optional[str]] = {
165192
'200': "GetResultResponse",
193+
'202': "GetResultResponse",
194+
'400': "ApiErrorResponse",
166195
'404': "ApiErrorResponse",
196+
'409': "GetResultResponse",
167197
}
168198
response_data = self.api_client.call_api(
169199
*_param,
@@ -180,6 +210,9 @@ def get_result_with_http_info(
180210
def get_result_without_preload_content(
181211
self,
182212
id: Annotated[StrictStr, Field(description="Result ID")],
213+
offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Rows to skip (default: 0)")] = None,
214+
limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Maximum rows to return (default: unbounded)")] = None,
215+
format: Annotated[Optional[StrictStr], Field(description="`arrow` or `json` — overrides the `Accept` header.")] = None,
183216
_request_timeout: Union[
184217
None,
185218
Annotated[StrictFloat, Field(gt=0)],
@@ -195,10 +228,16 @@ def get_result_without_preload_content(
195228
) -> RESTResponseType:
196229
"""Get result
197230
198-
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.
231+
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. | Result status | Status × body | |-----------------------|------------------------------------------------------------------------------| | `ready` + JSON | 200 `application/json` — `GetResultResponse` with `columns`, `rows`, etc. | | `ready` + Arrow | 200 `application/vnd.apache.arrow.stream` — schema, RecordBatches, EOS | | `pending`/`processing`| 202 `application/json` `{status, result_id}` + `Retry-After` | | `failed` | 409 `application/json` `{status, result_id, error_message}` | | not found | 404 `application/json` (`ApiErrorResponse`) | `?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. 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.
199232
200233
:param id: Result ID (required)
201234
:type id: str
235+
:param offset: Rows to skip (default: 0)
236+
:type offset: int
237+
:param limit: Maximum rows to return (default: unbounded)
238+
:type limit: int
239+
:param format: `arrow` or `json` — overrides the `Accept` header.
240+
:type format: str
202241
:param _request_timeout: timeout setting for this request. If one
203242
number provided, it will be total request
204243
timeout. It can also be a pair (tuple) of
@@ -223,6 +262,9 @@ def get_result_without_preload_content(
223262

224263
_param = self._get_result_serialize(
225264
id=id,
265+
offset=offset,
266+
limit=limit,
267+
format=format,
226268
_request_auth=_request_auth,
227269
_content_type=_content_type,
228270
_headers=_headers,
@@ -231,7 +273,10 @@ def get_result_without_preload_content(
231273

232274
_response_types_map: Dict[str, Optional[str]] = {
233275
'200': "GetResultResponse",
276+
'202': "GetResultResponse",
277+
'400': "ApiErrorResponse",
234278
'404': "ApiErrorResponse",
279+
'409': "GetResultResponse",
235280
}
236281
response_data = self.api_client.call_api(
237282
*_param,
@@ -243,6 +288,9 @@ def get_result_without_preload_content(
243288
def _get_result_serialize(
244289
self,
245290
id,
291+
offset,
292+
limit,
293+
format,
246294
_request_auth,
247295
_content_type,
248296
_headers,
@@ -267,6 +315,18 @@ def _get_result_serialize(
267315
if id is not None:
268316
_path_params['id'] = id
269317
# process the query parameters
318+
if offset is not None:
319+
320+
_query_params.append(('offset', offset))
321+
322+
if limit is not None:
323+
324+
_query_params.append(('limit', limit))
325+
326+
if format is not None:
327+
328+
_query_params.append(('format', format))
329+
270330
# process the header parameters
271331
# process the form parameters
272332
# process the body parameter
@@ -276,7 +336,8 @@ def _get_result_serialize(
276336
if 'Accept' not in _header_params:
277337
_header_params['Accept'] = self.api_client.select_header_accept(
278338
[
279-
'application/json'
339+
'application/json',
340+
'application/vnd.apache.arrow.stream'
280341
]
281342
)
282343

0 commit comments

Comments
 (0)