Skip to content

fix(gbif-eml): populate metadata.dates.creation for iso19139 export - #362

Merged
tomkralidis merged 1 commit into
geopython:masterfrom
nicokant:gbif-eml
Oct 3, 2026
Merged

tomkralidis merged 1 commit into
geopython:masterfrom
nicokant:gbif-eml

Conversation

@nicokant

Copy link
Copy Markdown
Contributor

Bug

The ISO19139 template (pygeometa/schemas/iso19139/main.j2:31) requires record['metadata']['dates']['creation'] with no fallback:

{% set datestamp = record['metadata']['dates']['creation']|normalize_datestring %}

GBIF_EMLOutputSchema.import_() never populated this field — it only set identification.dates.publication. Any MCF produced from GBIF-EML and rendered to ISO19139 hard-fails with:

UndefinedError: 'dict object' has no attribute 'dates'

Fix

Backfill metadata.dates.creation from the same publication date already extracted for identification.dates.publication.

Testing

  • tests/run_tests.py::PygeometaTest::test_import_metadata still passes
  • Full tests/run_tests.py suite passes (28/28)
  • Manually verified ISO19139OutputSchema().write() succeeds against tests/eml.xml and metadata.dates.creation resolves to 2022-07-01

The ISO19139 template requires record['metadata']['dates']['creation']
with no fallback, but GBIF_EMLOutputSchema.import_() never set it,
only identification.dates.publication. This caused a hard
UndefinedError when rendering ISO19139 XML from GBIF-EML-imported MCF.

Backfill metadata.dates.creation from the same publication date already
extracted for identification.dates.publication.
@nicokant
nicokant marked this pull request as ready for review October 2, 2026 09:50
@tomkralidis
tomkralidis merged commit 2504980 into geopython:master Oct 3, 2026
1 of 2 checks passed
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.

2 participants