AttributeError when setting limit argument in get_activities
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start in ayon_api/_api_helpers/activities.py around line 99 and reproduce the issue with the provided get_activities script using limit=10. Trace why activities_field is None before set_limit is called. Done means get_activities accepts limit without raising AttributeError and returns no more than the requested number of activities.
Written by the indexing model from the issue text.
Description
Is there an existing issue for this?
- I have searched the existing issues and added correct labels.
Description
Current Behavior
Specifying the limit argument when calling get_activities, will raise the following error :
Traceback (most recent call last):
File "<string>", line 8, in <module>
File "C:\Users\user\AppData\Local\Ynput\AYON\app\AYON 1.6.3\dependencies\ayon_api\_api_helpers\activities.py", line 99, in get_activities
activities_field.set_limit(limit)
^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'set_limit'
Expected Behavior
It should be possible to set the limit argument.
Steps To Reproduce:
Here is a small script that you can run in the AYON launcher console or with ayon_api directly with the right env vars set up. By running it you'll get the aforementioned error.
from ayon_api import get_activities
activities = get_activities(
project_name="projectname",
limit=10
)
for activity in activities:
print(activity)
Removing limit from this script and calling get_activities with project_name only will work (but be careful as it'll likely query all activities!).
Additional context:
Version
Server : 1.15.17
Launcher : 1.4.2 and 1.6.3
ayon-python-api : 1.2.4, 1.2.22 and 1.2.23
What platform were you running when you found the bug?
Windows
Relevant log output:
- Dominant language
- Python
- Stars
- 16
- Forks
- 15
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 10
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ynput/ayon-python-api
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
ynput/ayon-python-api#350 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
ynput/ayon-python-api#199 ·
-
ynput/ayon-python-api#198 · 1 assignee ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
ynput/ayon-python-api#182 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 55/100
ynput/ayon-python-api#181 ·
All issues in ynput/ayon-python-api
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100