Skip to content

Conversation

C-Loftus
Copy link
Contributor

Overview

  • Currrently in the EDR base provider there is a try except over every AttributeError in the query function
  • Thus, if a provider throws an AttributeError it will mistakenly say that the query is not implemented and it is possible to get confusing errors like these, when it reality is was coming from an AttributeError in the provider
NotImplementedError: Query "cube" not implemented in list ['locations', 'cube', 'area']

Fix

This PR fixes this behavior to:

  • put the try catch on only the getattr call so other AttributeErrors are preserved
  • add the names of the registered queries which is useful for debugging purposes
  • explicitly make sure query_type is passed in. Otherwise you would try to do getattr with None which could in the future cause other confusing issues

Related Issue / discussion

N/A

Additional information

N/A

Dependency policy (RFC2)

  • I have ensured that this PR meets RFC2 requirements

Updates to public demo

Contributions and licensing

(as per https://github.com/geopython/pygeoapi/blob/master/CONTRIBUTING.md#contributions-and-licensing)

  • I'd like to contribute [feature X|bugfix Y|docs|something else] to pygeoapi. I confirm that my contributions to pygeoapi will be compatible with the pygeoapi license guidelines at the time of contribution
  • I have already previously agreed to the pygeoapi Contributions and Licensing Guidelines

@C-Loftus
Copy link
Contributor Author

I am unclear why the build is failing. The tests all pass locally including the tile test in question that is failing. Is this a quirk of the ci environment in some way that I am overlooking? I can't think of any reason the change to EDR queries would affect tiles

@doublebyte1
Copy link
Contributor

I am unclear why the build is failing. The tests all pass locally including the tile test in question that is failing. Is this a quirk of the ci environment in some way that I am overlooking? I can't think of any reason the change to EDR queries would affect tiles

I think this test is unrelated to your PR. Let me double check and come back to you. Thanks

@C-Loftus
Copy link
Contributor Author

C-Loftus commented Oct 2, 2025

@doublebyte1 It seems there was a fix in the main branch. I have synced this PR so it should be all set now 👍

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.

2 participants