Skip to content

Fix sheets row cell values to round-trip scalars - #30

Closed
sminot wants to merge 1 commit into
mainfrom
fix/sheets-scalar-cell-values
Closed

sminot wants to merge 1 commit into
mainfrom
fix/sheets-scalar-cell-values

Conversation

@sminot

@sminot sminot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

RowInsertValues, RowUpdateValues and SheetQueryResponse.rows carried a second level of additional_properties, so a scalar cell value could not be represented in either direction:

# rows: [["G65", 3]]
ValueError: dictionary update sequence element #0 has length 1; 2 is required
# values["icd_code"] = "G65"
AttributeError: 'str' object has no attribute 'to_dict'

That left get_sheet_data, query_sheet_data, query_namespace_data, insert_sheet_data and update_sheet_data working only while the sheet was empty. The cells are free-form JSON, matching the Map<String, Object> and List<List<Object>> the API serves, so these models now carry a single level of additional_properties like Sample.metadata. The models are the generator's own output for the three corrected schemas; the rest of the spec is untouched to keep this off a full sync.

CirroBio/Cirro-backend#854 fixes RowInsert and RowUpdate at the source. SheetQueryResponse.rows cannot be fixed there — the cell sits two levels down in List<List<Object>> and micronaut-openapi has no annotation that reaches it — so the next schema sync will reintroduce the nested model for rows until the DTO signature changes.

Associated https://github.com/CirroBio/Cirro-backend/pull/854

Fixes #29

🤖 Generated with Claude Code

RowInsertValues, RowUpdateValues and SheetQueryResponse.rows were
generated with a second level of additional_properties, so a scalar cell
value could not be represented in either direction: parsing a row of
scalars raised ValueError, and serializing one raised AttributeError.
This made get_sheet_data, query_sheet_data, query_namespace_data,
insert_sheet_data and update_sheet_data unusable against any sheet
holding data.

The map values and row cells are free-form JSON, matching the Map<String,
Object> and List<List<Object>> the API actually serves, so these models
now carry a single level of additional_properties like Sample.metadata.

The source spec still declares these as `type: object`; until that is
corrected the next schema sync will reintroduce the nested models.

Fixes #29

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@sminot sminot closed this Sep 21, 2026
@sminot
sminot deleted the fix/sheets-scalar-cell-values branch September 21, 2026 23:05
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.

Sheets row cell values cannot round-trip scalars (read and write paths)

1 participant