rstudio / vetiver-python

Version, share, deploy, and monitor models.
https://rstudio.github.io/vetiver-python/stable/
MIT License
59 stars 17 forks source link

handling trailing backslash on prediction endpoints #194

Closed isabelizimm closed 10 months ago

isabelizimm commented 11 months ago

Currently, on Posit Connect, if you add a trailing backslash-- connectapi.com/myapi/predict/ rather than connectapi.com/myapi/predict-- you get a mysterious error:

ConnectionError: HTTPConnectionPool(host='xxx', port=000): Max retries exceeded with url: myapi/predict (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x2a109ea90>: Failed to resolve 'xxx' ([Errno 8] nodename nor servname provided, or not known)"))

right now, there is no url handling in the vetiver_endpoint function, but that might be a good place to ensure links are in the correct format.

FWIW: this error does not occur on a local endpoint or local on Docker

juliasilge commented 11 months ago

I think we already ran into this in the R package; it is fixed already here: https://github.com/rstudio/vetiver-r/blob/5d3fd53d91148f8115a3b3d56339f9ae765a991d/R/endpoint.R#L74-L78