stac-fastapi: Breaking Change on STAC Item datetime field
Hi
Thanks a lot for this cool tool-kit.
I seem to have problem with STAC Item datetime field serialization. DATETIME_RFC339 introduced in stac_fastapi/sqlalchemy/stac_fastapi/sqlalchemy/serializers.py is causing timestamp format conversion error. Applying a temporary fix of assigning DATETIME_RFC339 = "%Y-%m-%dT%H:%M:%S.%fZ" solves the issue. The RFC339 standard is missing %f portion of datetime. I’m not sure whether use of the standard in test files has an impact, but I changed all occurrence of RFC339 to my temporary fix to be on the safe side!
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (4 by maintainers)
I ran it against a few others:
for arrow, pendulum, and iso8601, non of them handle lowercase
torz(which is easy to remedy just by uppercasing the string). None of them also have an RFC 3339 specific parser, so they accept strings that are ISO8601 but not RFC3339.I’m most in favor of using ciso8601 and getting that one bug fixed with it.
I think
python-dateutilis fine, used it before in other projects. But I’d prefer using pydantic’s datetime parser in this situation to be consistent with the validation logic in stac-pydantic. Overall I don’t think eitherpython-dateutilorpydanticare what we will settle on long term, there is more context in #161So, that RFC 3339 datetime with the comma as a separator is actually invalid – for some reason, the RFC 3339 spec has an ISO 8601 ABNF in it, and I didn’t notice that that’s what it was when I created these examples.
I’m guessing you meant “only one failed”?
Cool; I also made a PR there for building binary wheels on releases (https://github.com/closeio/ciso8601/pull/109); if accepted it should enable installing in environments where a C compiler isn’t installed.