BritishGeologicalSurvey / pyagsapi

pyagsapi - An AGS Utilities API with AGS v4.x Schema Validation & Converter for .ags<-->.xslx files
https://britishgeologicalsurvey.github.io/pyagsapi/
GNU Lesser General Public License v3.0
12 stars 2 forks source link

Add ags_log endpoint #101

Closed KoalaGeo closed 1 year ago

KoalaGeo commented 1 year ago

Requests synthetic PDF log from Groundhog Web Viewer API (https://webservices.bgs.ac.uk/GWBV/viewborehole?loca_id=20200204094811691620) using BGS Loca ID.

Currently gets a 200 response but PDF doesn't display. Tried as both inline & attachment but PDF files are only 1kb - it's not actually pulling the PDF from the web viewer.

Addresses https://github.com/BritishGeologicalSurvey/pyagsapi/issues/100

ximenesuk commented 1 year ago

It would be good to add a basic integration test too.

KoalaGeo commented 1 year ago

It's working approximately as required, outstanding:

KoalaGeo commented 1 year ago

It would be good to add a basic integration test too.

Started with https://github.com/BritishGeologicalSurvey/pyagsapi/pull/101/commits/47e4298841286283d09da543d8398bb08d0606b5 but getting error TypeError: 'function' object does not support the asynchronous context manager protocol

KoalaGeo commented 1 year ago

Working with exception of error reporting:

Need to specify response_class & make it use errors.py in response. The existing errors in errors.py is appropriate.

volcan01010 commented 1 year ago

I've updated the function and tests to handle cases where the upstream API is offline or returning a 500 error. In this case, we will also return a 500 with a helpful message.

I'm happy for this to be merged now.