Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdf6e47d

Browse files
authored
feat: allow sorting of Actors collection (#422)
Added new sorting param sortBy for the new feature described in this[Issue](https://app.zenhub.com/workspaces/platform-team-5f6454160d9f82000fa6733f/issues/gh/apify/apify-core/20997)I will wait until [Apify-CorePR](apify/apify-core#21566) is deployed and thenwill merge this.One note, I am not sure if I added the sortBy parameter correctly.Example code below:`return await self._list(my=my, limit=limit, offset=offset, desc=desc,sortBy=sort_by)`I tried to follow similar examples with a camel case api parameter.Please let me know if this is not the correct syntax.
1 parent88cc4b7 commitdf6e47d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

‎src/apify_client/clients/resource_clients/actor_collection.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__importannotations
22

3-
fromtypingimportTYPE_CHECKING,Any
3+
fromtypingimportTYPE_CHECKING,Any,Literal
44

55
fromapify_shared.utilsimportfilter_out_none_values_recursively,ignore_docs
66

@@ -26,6 +26,7 @@ def list(
2626
limit:int|None=None,
2727
offset:int|None=None,
2828
desc:bool|None=None,
29+
sort_by:Literal['createdAt','lastRunStartedAt']|None='createdAt',
2930
)->ListPage[dict]:
3031
"""List the Actors the user has created or used.
3132
@@ -36,11 +37,12 @@ def list(
3637
limit: How many Actors to list.
3738
offset: What Actor to include as first when retrieving the list.
3839
desc: Whether to sort the Actors in descending order based on their creation date.
40+
sort_by: Field to sort the results by.
3941
4042
Returns:
4143
The list of available Actors matching the specified filters.
4244
"""
43-
returnself._list(my=my,limit=limit,offset=offset,desc=desc)
45+
returnself._list(my=my,limit=limit,offset=offset,desc=desc,sortBy=sort_by)
4446

4547
defcreate(
4648
self,
@@ -150,6 +152,7 @@ async def list(
150152
limit:int|None=None,
151153
offset:int|None=None,
152154
desc:bool|None=None,
155+
sort_by:Literal['createdAt','lastRunStartedAt']|None='createdAt',
153156
)->ListPage[dict]:
154157
"""List the Actors the user has created or used.
155158
@@ -160,11 +163,12 @@ async def list(
160163
limit: How many Actors to list.
161164
offset: What Actor to include as first when retrieving the list.
162165
desc: Whether to sort the Actors in descending order based on their creation date.
166+
sort_by: Field to sort the results by.
163167
164168
Returns:
165169
The list of available Actors matching the specified filters.
166170
"""
167-
returnawaitself._list(my=my,limit=limit,offset=offset,desc=desc)
171+
returnawaitself._list(my=my,limit=limit,offset=offset,desc=desc,sortBy=sort_by)
168172

169173
asyncdefcreate(
170174
self,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp