Implementation of new query param ?limit=N on walks (T2114)
Details
- Reviewers
vlorentz - Group Reviewers
Reviewers - Maniphest Tasks
- T2114: swh-graph API: add ?limit=N method variants to return first N results
- Commits
- rDGRPH70bc8ab474ff: Add ?limit=N method variants to return N results python list style
Diff Detail
- Repository
- rDGRPH Compressed graph representation
- Branch
- limit-param
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 10631 Build 15919: tox-on-jenkins Jenkins Build 15918: arc lint + arc unit
Event Timeline
Build is green
See https://jenkins.softwareheritage.org/job/DGRPH/job/tox/122/ for more details.
swh/graph/server/app.py | ||
---|---|---|
163 | It can if last is True. But there's still the open question of what to do with the /last endpoint as ?limit is supposed to be a generalization. So until then I don't know what this should be. |
swh/graph/server/app.py | ||
---|---|---|
163 | You keep saying/asking that, but the easy hack you're referring to already clarifies in its description that last is not a generalization of limit. I suggest you reread the task description. |
swh/graph/server/app.py | ||
---|---|---|
163 | I'm saying the contrary, that limit is a generalization of last, which is I think what is written in the task description. Does that mean a /last?limit=N returns the last N nodes ? |
swh/graph/server/app.py | ||
---|---|---|
163 | The task description specifies that ?limit is for the head, not the tail. If you want to generalize that to the tail and replace /last, maybe you could use positive numbers for head limits and negative numbers for tail limits?
This is consistent with what Python uses for indexing negative numbers, but I don't know if it's a good API. |
swh/graph/server/app.py | ||
---|---|---|
163 | I had the same idea and it's true that it seems weird for an API but why not. Tell me what way you'd prefer. |
swh/graph/server/app.py | ||
---|---|---|
163 | I'm fine with the positive/negative limit idea. |
Build is green
See https://jenkins.softwareheritage.org/job/DGRPH/job/tox/123/ for more details.
Build is green
See https://jenkins.softwareheritage.org/job/DGRPH/job/tox/124/ for more details.