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

fix: check none enddate in temporal validator #419

Merged
merged 2 commits into from
Sep 27, 2024

Conversation

smohiudd
Copy link
Contributor

@smohiudd smohiudd commented Aug 9, 2024

Fix temporal validator in cases where a collection has a null enddate as per STAC spec: https://github.com/radiantearth/stac-spec/blob/master/collection-spec/collection-spec.md#temporal-extent-object

Tested with the following dataset config:

{
  "collection": "fldas-soil-moisture-anomalies",
  "title": "FLDAS Surface Soil Moisture Anomalies",
  "data_type": "cog",
  "spatial_extent": {
    "xmin": -180,
    "ymin": -60,
    "xmax": 180,
    "ymax": 90
  },
  "temporal_extent": {
    "startdate": "1982-01-01T00:00:00Z",
    "enddate": null
  },
  "license": "not-provided",
  "description": "A 10 km global data product with 40 years of monthly soil moisture anomalies for food and water security monitoring from the Famine Early Warning System Network (FEWS NET) Land Data Assimilation System",
  "is_periodic": false,
  "time_density": "month",
  "sample_files": [
    "s3://veda-data-store-staging/fldas-soil-moisture-anomalies/FLDAS_NOAH01_SoilMoi00_10cm_tavg_C_GL_MA_ANOM198201_19820101.tif"
  ],
  "discovery_items": [
    {
      "discovery": "s3",
      "prefix": "fldas-soil-moisture-anomalies/",
      "bucket": "veda-data-store-staging",
      "filename_regex": "(.*)FLDAS_NOAH01_SoilMoi00_10cm_tavg_C_GL_MA_ANOM(.*).tif$"
    }
  ]
}

@smohiudd smohiudd changed the title Check none enddate in temporal validator fix: check none enddate in temporal validator Aug 9, 2024

@root_validator
def check_dates(cls, v):
if v["startdate"] >= v["enddate"]:
if (v["enddate"] is not None) and (v["startdate"] >= v["enddate"]):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since both start and end can be open in the spec (although not recommended) should we just allow it here, too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah good point, could have null for both start and end. I'll make a change

@smohiudd smohiudd marked this pull request as ready for review September 27, 2024 16:19
Copy link
Collaborator

@anayeaye anayeaye left a comment

Choose a reason for hiding this comment

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

Might need to watch the timing on the merge action for #431 before merging this one in

@smohiudd smohiudd merged commit 1d21109 into develop Sep 27, 2024
4 checks passed
anayeaye added a commit that referenced this pull request Oct 15, 2024
…lidation, add nlcd colormap (#434)

**Breaking**
feat(routes)!: remove cloudfront distribution and custom alternate
domain from backend #422

**Added** 
feat(raster-api): added custom NLCD colormap
#433
feat: add ecr endpoint
#432

**Fixed**
fix(tests): #425
fix(ingest): improved datetime validations
#419

**Changed**
ci: remove automated deployments to staging
#438
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