adafruit / Adafruit_IO_Python

Adafruit IO Python Client Library
Other
225 stars 99 forks source link

Implement a means of getting more than 1000 data points #131

Closed lcmcninch closed 2 years ago

lcmcninch commented 3 years ago

This PR resolves #108, at least partially. The end result is that the data method can use the limit query parameter and link header to return any number of data points (or all data points) of a feed. Current functionality returns all data up to 1000 points and doesn't provide the option to either decrease or increase that limit.

Scope of change:

Limitations:

lcmcninch commented 3 years ago

I made the requested change based on option two from my response. I query the feed count, and use that as max_results, if it is given as None. I'm not 100% sure that that query will always work, but it was the way I was able to find to get the number of records in a feed. If there's a cleaner way, please let me know.

lcmcninch commented 2 years ago

Apologies, I inadvertently deleted this branch, which closed the PR. I restored the branch and I am re-opening.

brentru commented 2 years ago

@lcmcninch Hi - could you resolve the conflicting files and I'll look at merging this in.

lcmcninch commented 2 years ago

@lcmcninch Hi - could you resolve the conflicting files and I'll look at merging this in.

@brentru No problem, conflict resolved. Thanks for looking at this!

jwcooper commented 2 years ago

I think we should drop the default from 1000 records to something much lower. In fact, I think we may change the server to default to a lower limit as well. I'd like to think 100 records is a better default limit.

lcmcninch commented 2 years ago

@jwcooper I'm happy to make the change, do you want me to reduce it to 100?

lcmcninch commented 2 years ago

I lowered the default limit to 100.

unlimitedbacon commented 2 years ago

Any update on getting this merged?