Comments (4)
The first error is happening because we add page parameters to all requests from all
. Because we paginate automatically, we disallow sending limit and page, which causes the second error.
Not sure if there should be a special case for distinct in these functions, or if distinct should be broken out into its own method, a.la. clever.Section.distinct("period")
.
I think from a readability/code complexity point of view, the second one is probably better (and I would lean towards that), but you could also make an argument that the smaller the API profile, the better (e.g. currently we only have two methods: iter
and all
).
from clever-python.
@azylman why doesn't distinct allow pagination?
from clever-python.
@dccarroll - Interesting catch - I didn't realize these were interdependent when we hardcoded limit
for pagination purposes.
limit
implies two things (1) MAX results to return (2) PAGE_SIZE. I suggest that clever-python hides (2) from the library consumer. (1) seems a much more sensible way of thinking about it from the library's perspective.
I don't like adding another method either; however, we might consider that the parameters need not exactly map to the API. as we do with all(), there could be more abstraction between the goal (fetching distinct items) and exactly what query parameters get passed behind the scenes to the API.
from clever-python.
No idea, I just know the API rejects any query parameters with distinct
except where
and limit
.
Maybe the aggregation pipeline (which we use for distinct) doesn't offsets?
from clever-python.
Related Issues (17)
- Queries with no results return garbage array HOT 3
- Where queries with arrays longer than 219 elements returns an API Error HOT 3
- Bindings for /me HOT 1
- Invalid Version (pip, setuptools, PyPi)
- APIError / Unicode error listing records HOT 2
- Homepage README code sample results in 401 using OAuth tokens HOT 1
- PyPI packages for 3.0.0? HOT 2
- Failing module import in python 3.6 HOT 2
- Cannot paginate results HOT 2
- python 3(.7) support HOT 5
- 3.0.2 on PyPi HOT 2
- Support for API v2.1
- Events API missing attributes
- Grade 13 breaks high grade check HOT 7
- ValueError: Invalid value for relationship (Guardian), must be one of ['Parent', 'Grandparent', 'Self', 'Aunt/Uncle', 'Sibling', 'Other', '']
- Error running `pip install clever` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clever-python.