AttributeError when setting limit argument in get_activities
还没有人认领这个 Issue。
评估
调研方向
从 ayon_api/_api_helpers/activities.py 第 99 行附近开始,使用提供的 get_activities 脚本和 limit=10 重现该问题。跟踪为什么在调用 set_limit 之前 activities_field 为 None。完成标准是 get_activities 接受 limit 而不引发 AttributeError,并且返回的活动数量不超过请求的数量。
由索引模型根据 Issue 内容生成。
描述
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:
- 主要语言
- Python
- 星标
- 16
- 派生
- 15
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 10
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ynput/ayon-python-api 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 68/100
ynput/ayon-python-api#350 ·
-
难度 3/5 1-2 天 新手友好度 45/100
ynput/ayon-python-api#199 ·
-
ynput/ayon-python-api#198 · 已指派 1 人 ·
-
难度 2/5 1-3 小时 新手友好度 50/100
ynput/ayon-python-api#182 ·
-
难度 1/5 1 小时以内 新手友好度 55/100
ynput/ayon-python-api#181 ·
查看 ynput/ayon-python-api 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 78/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 74/100