Skip to content

Parse ISO8601 format strings as datetimes#78

Merged
brycekbargar merged 2 commits intolibrary-data-platform:mainfrom
Five-Colleges-Incorporated:iso8601
Apr 27, 2026
Merged

Parse ISO8601 format strings as datetimes#78
brycekbargar merged 2 commits intolibrary-data-platform:mainfrom
Five-Colleges-Incorporated:iso8601

Conversation

@brycekbargar
Copy link
Copy Markdown
Collaborator

In FOLIO dates and times are usually RFC3339. During the initial re-implementation I didn't quite understand what that meant and hadn't dug any further because there was a bunch of other changes going into the release. In #77 it was determined that dates from FOLIO are commonly in the less restrictive ISO8601 format. After learning more about RFC3339 and ISO8601 I created a regex which I believe handles all the datetimes that FOLIO can return with two exceptions.

  1. While FOLIO claims to store everything in UTC it also claimed to return everything in RFC3339. I don't necessarily trust automatically converting datetimes without an offset to UTC.
  2. In the 5C instance some dates are returned that have a decimal indicating there should be fractional seconds but there aren't actually fractional seconds.

Many test cases for both the positive and negative case have been added to verify/document the supported conversion.

There was a latent fault in the sql for datetimes. The returned column was named is_uuid instead of is_datetime. Because the columns are read into python by position and not name this had not caused an error.

@brycekbargar brycekbargar merged commit c2fb942 into library-data-platform:main Apr 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant