Skip to content

chore: clarify sort and partition semantics in table schemas - #106

Merged
hotdata-automation[bot] merged 1 commit into
mainfrom
openapi-update-31089178085
Aug 6, 2026
Merged

chore: clarify sort and partition semantics in table schemas#106
hotdata-automation[bot] merged 1 commit into
mainfrom
openapi-update-31089178085

Conversation

@hotdata-automation

Copy link
Copy Markdown
Contributor

Auto-generated from the updated HotData OpenAPI spec.
Source: https://github.com/hotdata-dev/www.hotdata.dev/pull/309

@hotdata-automation
hotdata-automation Bot requested a review from a team as a code owner August 6, 2026 09:28
@hotdata-automation
hotdata-automation Bot requested review from zfarrell and removed request for a team August 6, 2026 09:28
@hotdata-automation
hotdata-automation Bot enabled auto-merge (squash) August 6, 2026 09:28
Comment thread src/models/table_info.rs
pub last_sync: Option<Option<String>>,
/// The table's partition keys, in the order they were declared when the table was created. Empty when the table is not partitioned. A table's storage layout is fixed when the table is created and cannot be changed afterwards, so this is how to confirm a table really was created with the layout that was asked for. The field is always present: an empty array means \"no partitioning declared\", which is not the same as a response that omits the field entirely. Reported for tables in a hotdata-managed database, which are the only ones whose layout is declared here. A table discovered from an external connection always reports an empty array — its layout belongs to the upstream system, so an empty array there means \"not known from here\", not \"confirmed unpartitioned\".
#[serde(rename = "partition_by")]
pub partition_by: Vec<models::TablePartitionKey>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: partition_by and sorted_by land as required, non-default fields on a response model, so any information_schema response that omits them fails to deserialize as a whole — the error surfaces as a parse failure on the entire page, not a missing field on one table. During a rolling deploy (or against a server that predates the spec change), information_schema_read and any downstream caller break rather than degrade.

This repo already treats that as a case worth deviating from the generator on — see the 0.10.0 CHANGELOG entry: "Pagination metadata on ListDatabasesResponse ... is now nullable so the client tolerates responses from a server that predates these fields (rolling deploy / version skew)." Note the request-side counterparts in AddManagedTableDecl are Option<Vec<..>>, so only the response side is strict.

Adding #[serde(default)] to both fields would keep the ergonomic non-Option type while tolerating an absent field (deserializing to an empty Vec, which the doc comment already defines as "none declared"). Best fixed upstream in the OpenAPI spec so it survives regeneration. (not blocking)

Comment thread CHANGELOG.md

### Changed

- chore: clarify sort and partition semantics in table schemas

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this entry reads as documentation-only ("clarify ... semantics"), but the diff also adds two required fields to TableInfo and changes TableInfo::new from 4 to 6 parameters — a source-breaking change for anyone constructing it. Other breaking entries in this file carry a **Breaking:** prefix; worth matching that here so the release notes reflect the constructor change. (not blocking)

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generated-code change; docs and model fields are consistent with the spec update. Two non-blocking inline notes (serde tolerance for the new required response fields, and CHANGELOG framing of the TableInfo::new signature change).

Note: integration tests and scenario-parity were still queued when this review ran, so I have no result for them either way.

@hotdata-automation
hotdata-automation Bot merged commit d880ed1 into main Aug 6, 2026
3 of 4 checks passed
@hotdata-automation
hotdata-automation Bot deleted the openapi-update-31089178085 branch August 6, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants