mediacloud / api-client

Public client for consuming content from the Media Cloud Online News Archive & Directory.
https://pypi.org/project/mediacloud/
Apache License 2.0
71 stars 27 forks source link

Cast `old_stopwords` to integer #76

Closed pypt closed 3 years ago

pypt commented 3 years ago

Hey Dennis,

You might want to cast old_stopwords to int here:

https://github.com/mediacloud/api-client/blob/e4eb22aa26775a3a5c5e7b65f44564381db2e1d8/mediacloud/api.py#L334-L347

similarly to how it's done with other booleans, e.g.:

'include_stopwords': 1 if include_stopwords is True else 0,

the reason being that Perl doesn't really have booleans and so we're expecting integers on the API, so trying to pass booleans to it might lead to various unexpected things.

After doing the change, don't forget to update the link in the blog post as well.

dsjen commented 3 years ago

Nice catch. Thank you!