ACCESS-Cloud-Based-InSAR / DockerizedTopsApp

Apache License 2.0
21 stars 2 forks source link

ensure creation_timestamp includes microseconds #151

Closed asjohnston-asf closed 10 months ago

asjohnston-asf commented 1 year ago

ASF's ingest workflow requires datetimes in the delivery metadata file to be formatted 2023-01-01T00:00:00.000000Z per the schema at https://github.com/asfadmin/grfn-ingest/blob/test/verify/src/metadata_schema.json

datetime.datetime.isoformat() does not include microseconds if the microsecond value is exactly zero:

>>> datetime.datetime(2023, 1, 1, 0, 0, 0).isoformat()
'2023-01-01T00:00:00'
>>> datetime.datetime(2023, 1, 1, 0, 0, 0, 1).isoformat()
'2023-01-01T00:00:00.000001'

This PR eliminates the one-in-a-million case where creation_timestamp did not include microseconds, causing ingest to ASF to fail. We saw one instance of this in the recent processing campaign.

cmarshak commented 1 year ago

Thanks for the explanation and quick resolution.