Skip to content

fix(dataset get): partitionColumn is an object, not a string#11

Open
adkinsty wants to merge 1 commit intomainfrom
fix/dataset-get-partition-column
Open

fix(dataset get): partitionColumn is an object, not a string#11
adkinsty wants to merge 1 commit intomainfrom
fix/dataset-get-partition-column

Conversation

@adkinsty
Copy link
Copy Markdown
Collaborator

@adkinsty adkinsty commented May 3, 2026

Summary

GET /api/v1/datasets/{id} returns partitionColumn as an object {name, columnType} (or null), but DatasetDetail.PartitionColumn was typed as string, causing every dataset get on a partitioned dataset to fail:

[Error] json: cannot unmarshal object into Go struct field DatasetDetail.partitionColumn of type string

Introduces PartitionColumnInfo struct, changes DatasetDetail.PartitionColumn to *PartitionColumnInfo, and updates the two display sites + JSON output map to handle the new shape (display Name (columnType), JSON emits the column name only since the surrounding map is still flat).

TimePartitionRequest.PartitionColumn (request payload) stays as string — it's just the column name on update.

Test plan

  • sodacli dataset get <partitioned-dataset-id> returns successfully with partitionColumn populated as the column name
  • sodacli dataset get <unpartitioned-dataset-id> returns successfully with no Partition column line shown
  • --output json emits a flat string for partitionColumn (column name) — unchanged shape, no breaking change for consumers
  • Build clean on this branch

GET /api/v1/datasets/{id} returns partitionColumn as an object
{name, columnType} (or null), but DatasetDetail.PartitionColumn was
typed as string, causing every dataset get on a partitioned dataset to
fail with:

  json: cannot unmarshal object into Go struct field
  DatasetDetail.partitionColumn of type string

Introduce PartitionColumnInfo struct, change DatasetDetail.PartitionColumn
to *PartitionColumnInfo, and update the two display sites + the JSON
output map to handle the new shape (display "Name (columnType)", JSON
emits the column name only since the surrounding map is still flat).

The TimePartitionRequest.PartitionColumn (request payload) stays as
string — it's just the column name on update.
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.

1 participant