Skip to content

Commit e21fa5e

Browse files
vdusekclaude
andcommitted
Merge master into fix/add-tagged-builds-parameter
Resolved conflict in actor.py by properly placing the tagged_builds parameter in the actor_dict structure. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2 parents 295974b + 03c5e3d commit e21fa5e

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
88
### 🐛 Bug Fixes
99

1010
- Update black to fix ReDoS vulnerability ([#582](https://github.com/apify/apify-client-python/pull/582)) ([aae2eb9](https://github.com/apify/apify-client-python/commit/aae2eb9f5aeda0c7274285b9aaab3c73550bcad6)) by [@B4nan](https://github.com/B4nan)
11+
- Only include Actor standby when at least one field is provided ([#597](https://github.com/apify/apify-client-python/pull/597)) ([7112c09](https://github.com/apify/apify-client-python/commit/7112c09ceab0d87a0bd0caecabea634c70f63b8c)) by [@vdusek](https://github.com/vdusek), closes [#595](https://github.com/apify/apify-client-python/issues/595)
1112

1213

1314
<!-- git-cliff-unreleased-end -->

src/apify_client/clients/resource_clients/actor.py

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def get_actor_representation(
6363
tagged_builds: dict[str, None | dict[str, str]] | None = None,
6464
) -> dict:
6565
"""Get dictionary representation of the Actor."""
66-
return {
66+
actor_dict = {
6767
'name': name,
6868
'title': title,
6969
'description': description,
@@ -86,18 +86,35 @@ def get_actor_representation(
8686
'body': example_run_input_body,
8787
'contentType': example_run_input_content_type,
8888
},
89-
'actorStandby': {
89+
'pricingInfos': pricing_infos,
90+
'actorPermissionLevel': actor_permission_level,
91+
}
92+
93+
# Only include actorStandby if at least one field is provided
94+
if any(
95+
[
96+
actor_standby_is_enabled is not None,
97+
actor_standby_desired_requests_per_actor_run is not None,
98+
actor_standby_max_requests_per_actor_run is not None,
99+
actor_standby_idle_timeout_secs is not None,
100+
actor_standby_build is not None,
101+
actor_standby_memory_mbytes is not None,
102+
]
103+
):
104+
actor_dict['actorStandby'] = {
90105
'isEnabled': actor_standby_is_enabled,
91106
'desiredRequestsPerActorRun': actor_standby_desired_requests_per_actor_run,
92107
'maxRequestsPerActorRun': actor_standby_max_requests_per_actor_run,
93108
'idleTimeoutSecs': actor_standby_idle_timeout_secs,
94109
'build': actor_standby_build,
95110
'memoryMbytes': actor_standby_memory_mbytes,
96-
},
97-
'pricingInfos': pricing_infos,
98-
'actorPermissionLevel': actor_permission_level,
99-
'taggedBuilds': tagged_builds,
100-
}
111+
}
112+
113+
# Add taggedBuilds if provided
114+
if tagged_builds is not None:
115+
actor_dict['taggedBuilds'] = tagged_builds
116+
117+
return actor_dict
101118

102119

103120
class ActorClient(ResourceClient):

0 commit comments

Comments
 (0)