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

Dataset/publish endpoint should not require optional parameters #193

Open
1 task
anayeaye opened this issue Jul 20, 2024 · 0 comments
Open
1 task

Dataset/publish endpoint should not require optional parameters #193

anayeaye opened this issue Jul 20, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@anayeaye
Copy link
Contributor

What

Missing optional parameters cause dataset/publish endpoint to fail with errors including:

{'loc': ('body', 'COGDataset', 'spatial_extent'), 'msg': 'field required', 'type': 'value_error.missing'}
{'loc': ('body', 'COGDataset', 'temporal_extent'), 'msg': 'field required', 'type': 'value_error.missing'}, 
{'loc': ('body', 'COGDataset', 'sample_files'), 'msg': 'field required', 'type': 'value_error.missing'}

Optional parameters causing errors

  • spatial_extent
  • temporal_extent
  • sample_files

A dataset that will fail

dataset-config.json
{
  "assets": {
    "thumbnail": {
      "description": "Photo by [Mick Truyts](https://unsplash.com/photos/x6WQeNYJC1w) (Power plant shooting steam at the sky)",
      "href": "https://thumbnails.openveda.cloud/no2--dataset-cover.jpg",
      "roles": [
        "thumbnail"
      ],
      "title": "Thumbnail",
      "type": "image/jpeg"
    }
  },
  "collection": "OMI_trno2-COG-deleteme",
  "data_type": "cog",
  "description": "OMI_trno2 - 0.10 x 0.10 Annual as Cloud-Optimized GeoTIFFs (COGs)",
  "discovery_items": [
    {
      "bucket": "veda-data-store-staging",
      "datetime_range": "year",
      "discovery": "s3",
      "filename_regex": "^(.*).tif$",
      "prefix": "OMI_trno2-COG/"
    }
  ],
  "is_periodic": true,
  "license": "MIT",
  "providers": [
    {
      "name": "NASA VEDA",
      "roles": [
        "host"
      ],
      "url": "https://www.earthdata.nasa.gov/dashboard/"
    }
  ],
  "renders": {
    "dashboard": {
      "assets": [
        "cog_default"
      ],
      "colormap_name": "reds",
      "rescale": [
        [
          0,
          3000000000000000
        ]
      ],
      "title": "VEDA Dashboard Render Parameters"
    }
  },
  "time_density": "year",
  "title": "DELETE ME OMI_trno2"
}

AC

  • Sensible defaults are used when optional parameters are not provided in request (instead of failing)
@anayeaye anayeaye added the bug Something isn't working label Jul 20, 2024
@ividito ividito self-assigned this Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants