Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve RFC 3339 datetime handling #368

Merged
merged 31 commits into from
Apr 14, 2022

Conversation

philvarner
Copy link
Collaborator

@philvarner philvarner commented Mar 2, 2022

Related Issue(s):

Description:

PR Checklist:

  • Code is formatted and linted (run pre-commit run --all-files)
  • Tests pass (run make test)
  • Documentation has been updated to reflect changes, if applicable, and docs build successfully (run make docs)
  • Changes are added to the CHANGELOG.

@philvarner philvarner changed the title improve RFC 3339 datetime handling WIP - improve RFC 3339 datetime handling Mar 2, 2022
@@ -171,18 +159,22 @@ def validate_datetime(cls, v):

dates = []
for value in values:
if value == "..":
dates.append(value)
if value == ".." or value == "":
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should probably be replace with parse_interval also

from typing import TypedDict

import attr
import geoalchemy2 as ga
from stac_pydantic.shared import DATETIME_RFC339
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DATETIME_RFC339 has been deprecated in stac_pydantic. It has several problems including, not parsing fractional seconds or timezones other than Z.

RUN python -m pip install --upgrade pip
RUN python -m pip install mkdocs mkdocs-material pdocs

COPY . /opt/src

WORKDIR /opt/src

RUN python -m pip install -e \
RUN python -m pip install \
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-e isn't needed in this case, and it only affects the first package name after it (rather than all of them)

@philvarner philvarner marked this pull request as ready for review April 1, 2022 02:16
@@ -10,6 +10,8 @@
"attrs",
"pydantic[dotenv]",
"stac_pydantic==2.0.*",
"pystac==1.*",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it took me 2 hours to figure out that the docs broke because I'd added an import from pystac, but it's not a dependency of this package. The tests worked because everything gets installed when they run.

@philvarner philvarner changed the title WIP - improve RFC 3339 datetime handling Improve RFC 3339 datetime handling Apr 1, 2022
@moradology
Copy link
Collaborator

Looks like a black update broke a whole bunch of builds out there: psf/black#2964

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.

3 participants