civisanalytics / civis-python

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

ENH add method to retrieve run outputs from future #381

Closed elsander closed 4 years ago

elsander commented 4 years ago

This PR adds a new method to CivisFuture objects, .outputs(), which blocks on job completion and returns the run outputs. I kept it as minimal as possible to make it generalizeable and easy to maintain, while still making it easy to maintain.

I tested the method manually on succeeded and failed container scripts using both CivisFuture and ContainerFuture, and also tested on a successful sql script. It's always challenging to add meaningful unit tests to the API client, so I'm happy for feedback on the unit testing I added.

elsander commented 4 years ago

@mheilman Okay, ready for another round of review.

elsander commented 4 years ago

@mheilman ready for another round!

elsander commented 4 years ago

I used the newline to match the formatting in the CivisFuture docstring itself, although it looks like we then don't use it in ContainerFuture, so not consistent throughout. I can update it in CivisFuture as well.

elsander commented 4 years ago

Ready for re-approval @mheilman