fix(dataset get): partitionColumn is an object, not a string#11
Open
fix(dataset get): partitionColumn is an object, not a string#11
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /api/v1/datasets/{id}returnspartitionColumnas an object{name, columnType}(or null), butDatasetDetail.PartitionColumnwas typed asstring, causing everydataset geton a partitioned dataset to fail:Introduces
PartitionColumnInfostruct, changesDatasetDetail.PartitionColumnto*PartitionColumnInfo, and updates the two display sites + JSON output map to handle the new shape (displayName (columnType), JSON emits the column name only since the surrounding map is still flat).TimePartitionRequest.PartitionColumn(request payload) stays asstring— it's just the column name on update.Test plan
sodacli dataset get <partitioned-dataset-id>returns successfully withpartitionColumnpopulated as the column namesodacli dataset get <unpartitioned-dataset-id>returns successfully with no Partition column line shown--output jsonemits a flat string forpartitionColumn(column name) — unchanged shape, no breaking change for consumers