numberly / appnexus-client

:snake: General purpose Python client for the AppNexus API
https://appnexus-client.readthedocs.io
MIT License
39 stars 19 forks source link

Remove prints from _send request in clients.py #47

Closed cpxi-admin closed 4 years ago

cpxi-admin commented 5 years ago

In client.py the function _send within the AppNexusClient class contains print(response.content) (line 90).

I am using the client to request reporting daily from AppNexus and the print makes request take significantly longer to download the report.

Whenever I use the report method below to get a report, report.download() prints the entire contents of the response. With large reports can take many minutes.

report = Report(json).save() resp = report.download()

When I use the client in a jupyter notebook I noticed the method does not print response.content and the download only takes seconds in comparison to minutes executing the same code in a .py file using terminal.

Could you remove the print(response.content) to help greatly increase execution speed?

ramnes commented 5 years ago

Indeed! I don't have access to a computer right now but feel free to open a pull request, this is pretty straight forward. :wink:

@rambobinator @shnups

rambobinator commented 4 years ago

Hi, thanks for posting this. It was apparently a package issue, the last pypi release should fix this.

https://pypi.org/project/AppNexus-client/#history

cpxi-admin commented 4 years ago

Awesome! Thank you for the quick turnaround on this, much appreciated.