refactor: Fix quirks in dataset spec types #207
Merged
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.
TableSchemaField
from an enum w/ one struct-like variant per data type => a struct with fields common to all data types—name
/description
/constraints
—plus a fieldtype_: FieldType
.FieldType
would hold the data type-specific bits, but currently there are none so the enum is just a "unit-only enum".missing_values
field, and other unused generated codeTable.schema
fromOption<TableSchema>
=>TableSchema
If you like you can go commit by commit to see step-by-step how I was able to do all this.
A cousin PR of this one was #98, which has more context on the origin of the cruft removed here.
Test plan
Verified that the serialized representation is safely changed, i.e., it retained the aspects our system actually depends on, while dropping unused bits. Running
init
in this branch produced a spec like: