BrandwatchLtd / bcr-api

Python Client Library for the Brandwatch Consumer Research API
MIT License
21 stars 23 forks source link

samplePercentage seems to need an additional parameter, userRequestedSampling, for a sample to be set when uploading a query #15

Closed pfairfax1 closed 4 years ago

pfairfax1 commented 4 years ago

If I do queries.upload() with samplePercentage=10, I would expect to see the samplePercentage field when I .get() that query to be set to 10. However, it is actually set to 100. @ctafoyabwatch did some investigation, and it looks like the userRequestedSampling field needs to be passed in as True for a user to manually set the sample rate (as opposed to BCR deciding the sample rate).

A simple fix might be to use to see if a user has passed in samplePercentage when uploading a query, and if so, set userRequestedSampling to True. We'll need to make sure this overrides the default value of 100.