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
- 17
- Forks
- 15
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 6
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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
-
type: enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ynput/ayon-python-api#363 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
ynput/ayon-python-api#384 ·
-
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 ·
-
Entity Hub: Refactor get children to work with added entity types supportMay be free again @iLLiCiTiT claimed this 766 days ago, and no pull request is open. Open
ynput/ayon-python-api#198 · 1 assignee ·
All issues in ynput/ayon-python-api
Similar issues
-
新功能建议
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Mai-with-u/MaiBot#2583 ·
Maintainers usually reply within 1 day
-
area-integrations
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
[New]: JambaOpenMatch Play
Difficulty 1/5 Under an hour Newbie friendliness 63/100
privacyguides/verified-apps#9224 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug]: The docs check fails to install the Mintlify CLI when it runs right after a `mint` releaseOpenchore upstream
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
MemMachine/MemMachine#2032 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100