geopython / pygeoapi

pygeoapi is a Python server implementation of the OGC API suite of standards. The project emerged as part of the next generation OGC API efforts in 2018 and provides the capability for organizations to deploy a RESTful OGC API endpoint using OpenAPI, GeoJSON, and HTML. pygeoapi is open source and released under an MIT license.
https://pygeoapi.io
MIT License
490 stars 260 forks source link

Graceful failure for xarray provider #1577

Closed sjordan29 closed 6 months ago

sjordan29 commented 7 months ago

Is your feature request related to a problem? Please describe. I'm primarily working with the xarray provider. When I work with a pygeoapi config file contains many resources, but just a subset of them fail to properly generate the openapi, the entire process fails.

Describe the solution you'd like I think it would be useful to have the xarray provider (and possibly other providers as well) fail gracefully and issue/log a warning for a resource and then continue to the next one. This would make it easier to identify the data source(s) that need to be corrected, but also make it so that a single invalid dataset doesn't prevent the entire build process.

tomkralidis commented 7 months ago

@sjordan29 thanks for the report. I've put forth #1585 to emit a warning on failing collections and carry on with the OpenAPI document generation. Are you able to test the PR? If it still fails, can you then provide an example configuration that would cause this issues you are running into?

pvgenuchten commented 7 months ago

What about a config flag to continue on failure, for some cases it may be critical all collections are valid

tomkralidis commented 7 months ago

Good idea as well @pvgenuchten. Added to PR (default behaviour is to fail).

sjordan29 commented 6 months ago

Great! Yes I will test with the config I've been working with -- thanks!

sjordan29 commented 6 months ago

Hi @tomkralidis, this worked great for my use case.