[REFACTOR] Make sources.dataset optional - #633
Conversation
Change the dataset field on SourceItem from required to optional in both the pydantic model and the JSON schema (schema/defs.yaml), and regenerate baseline schemas. Relaxing a constraint is a minor schema change, so this can ship ahead of the planned removal of dataset. Refs OvertureMaps/tf-data-platform#4684 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Alex Iannicelli <atiannicelli@gmail.com>
🗺️ Schema reference docs preview is live!
Note ♻️ This preview updates automatically with each push to this PR. |
There was a problem hiding this comment.
Pull request overview
This PR relaxes the schema constraint for sources[].dataset by making it optional across the Python Pydantic model, the shared JSON Schema definitions, and all regenerated theme baseline schemas—supporting incremental refactors ahead of planned removal of dataset from the sources column.
Changes:
- Made
SourceItem.datasetoptional in the Pydantic model and updated the shared JSON schema definition to removedatasetfrom the required list. - Regenerated and updated all theme baseline schemas to reflect that only
"property"remains required forSourceItem. - Updated tests to align expected JSON schema output and scaffold generation behavior with the new optionality.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| schema/defs.yaml | Removes dataset from sourcePropertyItem required fields in shared schema defs. |
| packages/overture-schema-common/src/overture/schema/common/sources.py | Makes SourceItem.dataset optional (`str |
| packages/overture-schema-common/tests/test_models.py | Updates expected JSON schema to require only "property" for SourceItem. |
| packages/overture-schema-codegen/tests/test_pyspark_scaffold.py | Updates scaffold expectations: required "property" present; optional "dataset" omitted. |
| packages/overture-schema-transportation-theme/tests/segment_baseline_schema.json | Regenerated baseline: SourceItem.required drops "dataset". |
| packages/overture-schema-transportation-theme/tests/connector_baseline_schema.json | Regenerated baseline: SourceItem.required drops "dataset". |
| packages/overture-schema-places-theme/tests/place_baseline_schema.json | Regenerated baseline: SourceItem.required drops "dataset". |
| packages/overture-schema-divisions-theme/tests/division_boundary_baseline_schema.json | Regenerated baseline: SourceItem.required drops "dataset". |
| packages/overture-schema-divisions-theme/tests/division_baseline_schema.json | Regenerated baseline: SourceItem.required drops "dataset". |
| packages/overture-schema-divisions-theme/tests/division_area_baseline_schema.json | Regenerated baseline: SourceItem.required drops "dataset". |
| packages/overture-schema-buildings-theme/tests/building_part_baseline_schema.json | Regenerated baseline: SourceItem.required drops "dataset". |
| packages/overture-schema-buildings-theme/tests/building_baseline_schema.json | Regenerated baseline: SourceItem.required drops "dataset". |
| packages/overture-schema-base-theme/tests/water_baseline_schema.json | Regenerated baseline: SourceItem.required drops "dataset". |
| packages/overture-schema-base-theme/tests/land_use_baseline_schema.json | Regenerated baseline: SourceItem.required drops "dataset". |
| packages/overture-schema-base-theme/tests/land_cover_baseline_schema.json | Regenerated baseline: SourceItem.required drops "dataset". |
| packages/overture-schema-base-theme/tests/land_baseline_schema.json | Regenerated baseline: SourceItem.required drops "dataset". |
| packages/overture-schema-base-theme/tests/infrastructure_baseline_schema.json | Regenerated baseline: SourceItem.required drops "dataset". |
| packages/overture-schema-base-theme/tests/bathymetry_baseline_schema.json | Regenerated baseline: SourceItem.required drops "dataset". |
| packages/overture-schema-addresses-theme/tests/address_baseline_schema.json | Regenerated baseline: SourceItem.required drops "dataset". |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Victor Schappert (vcschapp)
left a comment
There was a problem hiding this comment.
Alex Iannicelli (@atiannicelli) could you include a towncrier changelog fragment with this?
Sorry for this - we just merged the publishing workflow PR that requires a changelog fragment, so it's a bit of a surprise new requirement. The docs/versioning.md should explain how to do this.
…rces-dataset-optional Signed-off-by: Alex Iannicelli <atiannicelli@gmail.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Alex Iannicelli <atiannicelli@gmail.com>
…rces-dataset-optional Signed-off-by: Alex Iannicelli <atiannicelli@gmail.com> # Conflicts: # packages/overture-schema-theme-addresses/changelog.d/633.misc.md # packages/overture-schema-theme-base/changelog.d/633.misc.md # packages/overture-schema-theme-buildings/changelog.d/633.misc.md # packages/overture-schema-theme-divisions/changelog.d/633.misc.md # packages/overture-schema-theme-places/changelog.d/633.misc.md # packages/overture-schema-theme-transportation/changelog.d/633.misc.md
16a0911
Summary
Changes the
datasetfield on theSourceItemmodel from required to optional, in both the Pydantic model and the JSON schema. Relaxing a constraint is a minor schema change, so this can ship ahead of the planned removal ofdatasetfrom thesourcescolumn.2026-09-23.0Changes
packages/overture-schema-common/src/overture/schema/common/sources.py—datasetmoved from the required section to optional (str | None = None)schema/defs.yaml—sourcePropertyItem.requiredchanged from[property, dataset]to[property]make update-baselines(mechanicalrequiredlist change only)packages/overture-schema-common/tests/test_models.py— expected JSON schema updatedpackages/overture-schema-codegen/tests/test_pyspark_scaffold.py— scaffold test updated:datasetis no longer populated as a required siblingTesting
pytest packages/— 3059 passed (excluding pyspark suite, which has pre-existing environment-only Spark FileIO teardown warnings unrelated to this change; verified the same errors occur on a clean tree)SourceItem(property="")now validates withoutdataset, and still accepts it when presentrequiredlist changedImpact
datasetremains validdatasetnow pass validation