Skip to content

fix: preserve user-defined data_* properties on data_file nodes#67

Merged
JoshuaHarris391 merged 1 commit into
mainfrom
fix/preserve-user-defined-file-props
Apr 20, 2026
Merged

fix: preserve user-defined data_* properties on data_file nodes#67
JoshuaHarris391 merged 1 commit into
mainfrom
fix/preserve-user-defined-file-props

Conversation

@JoshuaHarris391

@JoshuaHarris391 JoshuaHarris391 commented Apr 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • construct_props in src/gen3schemadev/converter.py unconditionally overwrote data_category, data_format, data_type, and core_metadata_collections on any data_file node, silently discarding enum values a user had declared in input.yaml.
  • Switched those four assignments from dict[key] = to dict.setdefault(key, ...) so the hardcoded placeholders only apply when the user has not already defined the property.
  • Added 6 regression tests in tests/test_converter.py plus a new fixture tests/input_example_file_props.yml covering: preservation of each of the three reported properties, preservation of core_metadata_collections, the default-injection fallback path, and an end-to-end populate_template round-trip.

Test plan

  • poetry run python3 -m pytest tests/test_converter.py -v — 32/32 pass
  • poetry run python3 -m pytest tests/ — full suite 99/99 pass
  • CI Build and Test workflow green

construct_props unconditionally overwrote data_category, data_format,
data_type and core_metadata_collections for any data_file node, silently
discarding enum values a user had declared in input.yaml. Switch to
setdefault so the hardcoded placeholders only apply when the user has not
already defined the property.
@JoshuaHarris391
JoshuaHarris391 merged commit a1046d2 into main Apr 20, 2026
2 checks passed
@JoshuaHarris391
JoshuaHarris391 deleted the fix/preserve-user-defined-file-props branch April 20, 2026 05:10
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