civisanalytics / civis-python

Civis API Python Client
BSD 3-Clause "New" or "Revised" License
34 stars 26 forks source link

Fix handling of empty responses from run cancellation endpoints. #287

Closed mheilman closed 5 years ago

mheilman commented 5 years ago

The Scripts and Jobs run cancellation endpoints (e.g., DELETE /jobs/{job_id}/runs/{run_id}) return an empty response with a 202 error code, which is reasonable, I think.

The client currently raises a CivisClientError("Unable to parse JSON from response", ...) in that case because it only expects empty responses for 204 or 205. This fixes that so that users will be able to use the client with those endpoints.