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
31 changes: 31 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# NOTE: This file is auto generated by OpenAPI Generator.
# URL: https://openapi-generator.tech
#
# ref: https://docs.gitlab.com/ee/ci/README.html
# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml

stages:
- test

.pytest:
stage: test
script:
- pip install -r requirements.txt
- pip install -r test-requirements.txt
- pytest --cov=hotdata

pytest-3.9:
extends: .pytest
image: python:3.9-alpine
pytest-3.10:
extends: .pytest
image: python:3.10-alpine
pytest-3.11:
extends: .pytest
image: python:3.11-alpine
pytest-3.12:
extends: .pytest
image: python:3.12-alpine
pytest-3.13:
extends: .pytest
image: python:3.13-alpine
2 changes: 0 additions & 2 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,4 @@ requirements.txt
setup.cfg
test-requirements.txt
test/__init__.py
test/test_load_managed_table_request.py
test/test_load_managed_table_response.py
tox.ini
17 changes: 11 additions & 6 deletions docs/ResultsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@ Retrieve a persisted query result by ID. The response format for the `ready` sta
|-----------------------|------------------------------------------------------------------------------|
| `ready` + JSON | 200 `application/json` — `GetResultResponse` with `columns`, `rows`, etc. |
| `ready` + Arrow | 200 `application/vnd.apache.arrow.stream` — schema, RecordBatches, EOS |
| `ready` + CSV | 200 `text/csv; charset=utf-8` — single header row, streamed batch-by-batch |
| `ready` + Markdown | 200 `text/markdown; charset=utf-8` — GitHub-flavored pipe table, streamed |
| `ready` + Parquet | 200 `application/vnd.apache.parquet` — raw parquet bytes (no conversion) |
| `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.
`?format=` accepts `arrow`, `json`, `csv`, `md`, `parquet` and takes precedence over `Accept`. `markdown` is accepted as a runtime alias for `md` (the OpenAPI enum lists only `md` to keep the SDK shape clean). 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. `?offset`/`?limit` are ignored for `format=parquet` since that path returns the underlying file unchanged.

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.
Ready responses (Arrow, CSV, Markdown, JSON) carry `X-Total-Row-Count` (full result row count from parquet metadata, independent of offset/limit). The streaming paths run 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.

IEEE special floats (`±Inf`, `NaN`) have no canonical JSON representation. For cross-format consistency the JSON, CSV, and Markdown paths emit them as `null` / empty cells, and JSON `nullable[]` is widened to match. The Arrow IPC and Parquet bodies are binary round-trip formats and preserve the raw IEEE values; callers cross-checking a result across CSV and Parquet should not byte-compare those slots.

### Example

Expand Down Expand Up @@ -75,7 +80,7 @@ with hotdata.ApiClient(configuration) as api_client:
id = 'id_example' # str | Result ID
offset = 56 # int | Rows to skip (default: 0) (optional)
limit = 56 # int | Maximum rows to return (default: unbounded) (optional)
format = hotdata.ResultsFormatQuery() # ResultsFormatQuery | `arrow` or `json` — overrides the `Accept` header. (optional)
format = hotdata.ResultsFormatQuery() # ResultsFormatQuery | `arrow`, `json`, `csv`, `md`, or `parquet` — overrides the `Accept` header. `markdown` is also accepted at runtime as an alias for `md`, but is not in the OpenAPI enum to keep the SDK shape clean. (optional)

try:
# Get result
Expand All @@ -96,7 +101,7 @@ Name | Type | Description | Notes
**id** | **str**| Result ID |
**offset** | **int**| Rows to skip (default: 0) | [optional]
**limit** | **int**| Maximum rows to return (default: unbounded) | [optional]
**format** | [**ResultsFormatQuery**](.md)| `arrow` or `json` — overrides the `Accept` header. | [optional]
**format** | [**ResultsFormatQuery**](.md)| `arrow`, `json`, `csv`, `md`, or `parquet` — overrides the `Accept` header. `markdown` is also accepted at runtime as an alias for `md`, but is not in the OpenAPI enum to keep the SDK shape clean. | [optional]

### Return type

Expand All @@ -109,13 +114,13 @@ Name | Type | Description | Notes
### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json, application/vnd.apache.arrow.stream
- **Accept**: application/json, application/vnd.apache.arrow.stream, text/csv, text/markdown, application/vnd.apache.parquet

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**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> |
**200** | Result data. The body depends on the negotiated format: JSON callers receive &#x60;GetResultResponse&#x60;; Arrow callers receive an Arrow IPC stream; CSV callers receive comma-separated text (LF-terminated, double-quote escaped, RFC 4180-style quoting but not RFC 4180-strict on line endings); Markdown callers receive a single GitHub-flavored pipe table; Parquet callers receive the raw parquet bytes from object storage. Non-finite floats (&#x60;±Inf&#x60;, &#x60;NaN&#x60;) render as &#x60;null&#x60; (JSON) or empty cells (CSV, Markdown) for cross-format consistency. &#x60;Accept&#x60; is treated as a flat content-type list — &#x60;q&#x3D;&#x60; quality values are ignored; use &#x60;?format&#x3D;&#x60; to disambiguate. | * 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> |
**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> |
**400** | Invalid offset, limit, or format. | - |
**404** | Result not found. | - |
Expand Down
8 changes: 7 additions & 1 deletion docs/ResultsFormatQuery.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# ResultsFormatQuery

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.
Schema for the `?format=` query parameter on `GET /v1/results/{id}`. Documents the canonical values that SDKs should treat as a closed set (`arrow`, `json`, `csv`, `md`, `parquet`). The runtime handler's negotiator (`negotiate_results_format`) additionally accepts `markdown` as an alias for `md` — case-insensitive, with unknown values falling through to the `Accept` header — but `markdown` is intentionally NOT listed in this enum so SDK generators emit a single canonical `Markdown` (or equivalent) variant rather than two distinct ones for the same logical format.

## Enum

* `ARROW` (value: `'arrow'`)

* `JSON` (value: `'json'`)

* `CSV` (value: `'csv'`)

* `MD` (value: `'md'`)

* `PARQUET` (value: `'parquet'`)

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


Loading