HumanSignal / HumanSignal/label-studio-sdk
Client get_projects/list_projects does not retrieve all projects
- Dominant language
- Python
- Stars
- 192
- Forks
- 127
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 1
Description
Versions:
```
$ pip freeze | grep label
label-studio==1.21.0
label-studio-sdk==2.0.4
```
When calling `get_projects`/`list_projects`, the result will only fetch a maximum of 100 projects, even though the docstrings indicate they should list ALL projects in Label Studio. This also seems to affect manual requests to the `/api/projects` endpoint when trying to up the `page_size`.
The following snippet prints out the following output:
```python
from label_studio_sdk import Client
def main():
projects = LS_CLIENT.list_projects()
print("get_projects length:", len(projects))
manual = LS_CLIENT.make_request("GET", "/api/projects", params={'page_size': 500})
res = manual.json()
print('manual request length', len(res['results']))
print('count:', res['count'])
```
```
~$ python script.py
get_projects length: 100
manual request length 100
count: 201
```
There seemed to have been a similar issue previously with tasks ([label-studio #1908](https://github.com/HumanSignal/label-studio/issues/1908)) that was solved with #31. Perhaps a paginated request solution is needed for projects as well?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.