VingtCinq / python-mailchimp

Python client for v3 of MailChimp API
MIT License
463 stars 131 forks source link

Similar request error handling fix to #167 for remaining requests #207

Closed markberger closed 5 years ago

markberger commented 5 years ago

I am getting JSONDecodeError messages when receiving a 504 response in def _get here similar to #167. This implements the same fix that is in 3377ea9 and 95f1edc for other requests.

stephenross commented 5 years ago

That looks good, update the docs with the information if it needs it and increment the version numbers in the readme files and the setup.py. Also, if you could provide any info you have on which specific calls you are making that are returning 504 in a comment on this, that would also be helpful.

markberger commented 5 years ago

The 504 error occurs intermittently when I call client.reports.email_activity.all. After reaching out to mailchimp support, they said that hitting this endpoint with count=1000 is very expensive on their end. They suggested that I reduce the count to 500. Unfortunately the count of 1000 is hardcoded here:

https://github.com/VingtCinq/python-mailchimp/blob/master/mailchimp3/baseapi.py#L36

I'll open a second pr that drops this hardcoded value.

markberger commented 5 years ago

@stephenross this should now be good to go

stephenross commented 5 years ago

@charlesthk If you could put this on pypi, that would be awesome

charlesthk commented 5 years ago

@stephenross v3.0.9 is now on Pypi ! Thanks.