Skip to content

Commit 322306d

Browse files
vdusekclaude
andcommitted
refactor: remove type mentions from parameter docstrings
Types are already specified in type hints, so docstrings should not redundantly mention them. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9d791fa commit 322306d

File tree

5 files changed

+26
-26
lines changed

5 files changed

+26
-26
lines changed

src/apify_client/_internal_models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class WebhookRepresentationList(RootModel[list[WebhookRepresentation]]):
5252

5353
@classmethod
5454
def from_webhooks(cls, webhooks: list[dict | WebhookCreate]) -> WebhookRepresentationList:
55-
"""Construct from a list of webhook dictionaries or `WebhookCreate` models."""
55+
"""Construct from a list of webhook dictionaries."""
5656
representations = []
5757
for webhook in webhooks:
5858
webhook_dict = webhook.model_dump(exclude_none=True) if isinstance(webhook, WebhookCreate) else webhook
@@ -74,11 +74,11 @@ def encode_to_base64(cls, webhooks: list[dict | WebhookCreate]) -> str: ...
7474

7575
@classmethod
7676
def encode_to_base64(cls, webhooks: list[dict | WebhookCreate] | None) -> str | None:
77-
"""Encode a list of webhook dictionaries or `WebhookCreate` models to base64 for API transmission.
77+
"""Encode a list of webhooks to base64 for API transmission.
7878
7979
Args:
80-
webhooks: A list of webhook dictionaries or `WebhookCreate` models with keys like
81-
`event_types`, `request_url`, etc. If None, returns None.
80+
webhooks: A list of webhooks with keys like `event_types`, `request_url`, etc.
81+
If None, returns None.
8282
8383
Returns:
8484
A base64-encoded JSON string, or None if webhooks is None.

src/apify_client/_resource_clients/actor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def start(
252252
webhooks: Optional ad-hoc webhooks (https://docs.apify.com/webhooks/ad-hoc-webhooks) associated with
253253
the Actor run which can be used to receive a notification, e.g. when the Actor finished or failed.
254254
If you already have a webhook set up for the Actor or task, you do not have to add it again here.
255-
Each webhook is represented by a dictionary or `WebhookCreate` model containing these items:
255+
Each webhook is represented by a dictionary containing these items:
256256
* `event_types`: List of `WebhookEventType` values which trigger the webhook.
257257
* `request_url`: URL to which to send the webhook HTTP request.
258258
* `payload_template`: Optional template for the request payload.
@@ -717,7 +717,7 @@ async def start(
717717
webhooks: Optional ad-hoc webhooks (https://docs.apify.com/webhooks/ad-hoc-webhooks) associated with
718718
the Actor run which can be used to receive a notification, e.g. when the Actor finished or failed.
719719
If you already have a webhook set up for the Actor or task, you do not have to add it again here.
720-
Each webhook is represented by a dictionary or `WebhookCreate` model containing these items:
720+
Each webhook is represented by a dictionary containing these items:
721721
* `event_types`: List of `WebhookEventType` values which trigger the webhook.
722722
* `request_url`: URL to which to send the webhook HTTP request.
723723
* `payload_template`: Optional template for the request payload.

src/apify_client/_resource_clients/request_queue.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def add_request(self, request: dict | RequestDraft, *, forefront: bool | None =
172172
https://docs.apify.com/api/v2#/reference/request-queues/request-collection/add-request
173173
174174
Args:
175-
request: The request to add to the queue, as a dictionary or `RequestDraft` model.
175+
request: The request to add to the queue.
176176
forefront: Whether to add the request to the head or the end of the queue.
177177
178178
Returns:
@@ -226,7 +226,7 @@ def update_request(self, request: dict | Request, *, forefront: bool | None = No
226226
https://docs.apify.com/api/v2#/reference/request-queues/request/update-request
227227
228228
Args:
229-
request: The updated request, as a dictionary or `Request` model.
229+
request: The updated request.
230230
forefront: Whether to put the updated request in the beginning or the end of the queue.
231231
232232
Returns:
@@ -335,7 +335,7 @@ def batch_add_requests(
335335
https://docs.apify.com/api/v2#/reference/request-queues/batch-request-operations/add-requests
336336
337337
Args:
338-
requests: List of requests to be added to the queue, each as a dictionary or `RequestDraft` model.
338+
requests: List of requests to be added to the queue.
339339
forefront: Whether to add requests to the front of the queue.
340340
max_parallel: Specifies the maximum number of parallel tasks for API calls. This is only applicable
341341
to the async client. For the sync client, this value must be set to 1, as parallel execution
@@ -411,7 +411,7 @@ def batch_delete_requests(self, requests: list[dict | RequestDraft]) -> BatchDel
411411
https://docs.apify.com/api/v2#/reference/request-queues/batch-request-operations/delete-requests
412412
413413
Args:
414-
requests: List of the requests to delete, each as a dictionary or `RequestDraft` model.
414+
requests: List of the requests to delete.
415415
"""
416416
requests_as_dicts: list[dict] = [
417417
(RequestDraft.model_validate(r) if isinstance(r, dict) else r).model_dump(by_alias=True, exclude_none=True)
@@ -602,7 +602,7 @@ async def add_request(self, request: dict | RequestDraft, *, forefront: bool | N
602602
https://docs.apify.com/api/v2#/reference/request-queues/request-collection/add-request
603603
604604
Args:
605-
request: The request to add to the queue, as a dictionary or `RequestDraft` model.
605+
request: The request to add to the queue.
606606
forefront: Whether to add the request to the head or the end of the queue.
607607
608608
Returns:
@@ -654,7 +654,7 @@ async def update_request(self, request: dict | Request, *, forefront: bool | Non
654654
https://docs.apify.com/api/v2#/reference/request-queues/request/update-request
655655
656656
Args:
657-
request: The updated request, as a dictionary or `Request` model.
657+
request: The updated request.
658658
forefront: Whether to put the updated request in the beginning or the end of the queue.
659659
660660
Returns:
@@ -813,7 +813,7 @@ async def batch_add_requests(
813813
https://docs.apify.com/api/v2#/reference/request-queues/batch-request-operations/add-requests
814814
815815
Args:
816-
requests: List of requests to be added to the queue, each as a dictionary or `RequestDraft` model.
816+
requests: List of requests to be added to the queue.
817817
forefront: Whether to add requests to the front of the queue.
818818
max_parallel: Specifies the maximum number of parallel tasks for API calls. This is only applicable
819819
to the async client. For the sync client, this value must be set to 1, as parallel execution
@@ -891,7 +891,7 @@ async def batch_delete_requests(self, requests: list[dict | RequestDraft]) -> Ba
891891
https://docs.apify.com/api/v2#/reference/request-queues/batch-request-operations/delete-requests
892892
893893
Args:
894-
requests: List of the requests to delete, each as a dictionary or `RequestDraft` model.
894+
requests: List of the requests to delete.
895895
"""
896896
requests_as_dicts: list[dict] = [
897897
(RequestDraft.model_validate(r) if isinstance(r, dict) else r).model_dump(by_alias=True, exclude_none=True)

src/apify_client/_resource_clients/task.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def update(
101101
in the task settings.
102102
restart_on_error: If true, the Task run process will be restarted whenever it exits with
103103
a non-zero status code.
104-
task_input: Task input dictionary or `TaskInput` model.
104+
task_input: Task input dictionary.
105105
title: A human-friendly equivalent of the name.
106106
actor_standby_desired_requests_per_actor_run: The desired number of concurrent HTTP requests for
107107
a single Actor Standby run.
@@ -164,7 +164,7 @@ def start(
164164
https://docs.apify.com/api/v2#/reference/actor-tasks/run-collection/run-task
165165
166166
Args:
167-
task_input: Task input dictionary or `TaskInput` model.
167+
task_input: Task input dictionary.
168168
build: Specifies the Actor build to run. It can be either a build tag or build number. By default,
169169
the run uses the build specified in the task settings (typically latest).
170170
max_items: Maximum number of results that will be returned by this run. If the Actor is charged
@@ -180,7 +180,7 @@ def start(
180180
webhooks: Optional ad-hoc webhooks (https://docs.apify.com/webhooks/ad-hoc-webhooks) associated with
181181
the Actor run which can be used to receive a notification, e.g. when the Actor finished or failed.
182182
If you already have a webhook set up for the Actor or task, you do not have to add it again here.
183-
Each webhook is represented by a dictionary or `WebhookCreate` model containing these items:
183+
Each webhook is represented by a dictionary containing these items:
184184
* `event_types`: List of `WebhookEventType` values which trigger the webhook.
185185
* `request_url`: URL to which to send the webhook HTTP request.
186186
* `payload_template`: Optional template for the request payload.
@@ -231,7 +231,7 @@ def call(
231231
https://docs.apify.com/api/v2#/reference/actor-tasks/run-collection/run-task
232232
233233
Args:
234-
task_input: Task input dictionary or `TaskInput` model.
234+
task_input: Task input dictionary.
235235
build: Specifies the Actor build to run. It can be either a build tag or build number. By default,
236236
the run uses the build specified in the task settings (typically latest).
237237
max_items: Maximum number of results that will be returned by this run. If the Actor is charged per result,
@@ -295,7 +295,7 @@ def update_input(self, *, task_input: dict | TaskInput) -> dict:
295295
https://docs.apify.com/api/v2#/reference/actor-tasks/task-input-object/update-task-input
296296
297297
Args:
298-
task_input: The new default input for this task, as a dictionary or `TaskInput` model.
298+
task_input: The new default input for this task.
299299
300300
Returns:
301301
The updated task input.
@@ -405,7 +405,7 @@ async def update(
405405
in the task settings.
406406
restart_on_error: If true, the Task run process will be restarted whenever it exits with
407407
a non-zero status code.
408-
task_input: Task input dictionary or `TaskInput` model.
408+
task_input: Task input dictionary.
409409
title: A human-friendly equivalent of the name.
410410
actor_standby_desired_requests_per_actor_run: The desired number of concurrent HTTP requests for
411411
a single Actor Standby run.
@@ -468,7 +468,7 @@ async def start(
468468
https://docs.apify.com/api/v2#/reference/actor-tasks/run-collection/run-task
469469
470470
Args:
471-
task_input: Task input dictionary or `TaskInput` model.
471+
task_input: Task input dictionary.
472472
build: Specifies the Actor build to run. It can be either a build tag or build number. By default,
473473
the run uses the build specified in the task settings (typically latest).
474474
max_items: Maximum number of results that will be returned by this run. If the Actor is charged
@@ -484,7 +484,7 @@ async def start(
484484
webhooks: Optional ad-hoc webhooks (https://docs.apify.com/webhooks/ad-hoc-webhooks) associated with
485485
the Actor run which can be used to receive a notification, e.g. when the Actor finished or failed.
486486
If you already have a webhook set up for the Actor or task, you do not have to add it again here.
487-
Each webhook is represented by a dictionary or `WebhookCreate` model containing these items:
487+
Each webhook is represented by a dictionary containing these items:
488488
* `event_types`: List of `WebhookEventType` values which trigger the webhook.
489489
* `request_url`: URL to which to send the webhook HTTP request.
490490
* `payload_template`: Optional template for the request payload.
@@ -535,7 +535,7 @@ async def call(
535535
https://docs.apify.com/api/v2#/reference/actor-tasks/run-collection/run-task
536536
537537
Args:
538-
task_input: Task input dictionary or `TaskInput` model.
538+
task_input: Task input dictionary.
539539
build: Specifies the Actor build to run. It can be either a build tag or build number. By default,
540540
the run uses the build specified in the task settings (typically latest).
541541
max_items: Maximum number of results that will be returned by this run. If the Actor is charged per result,
@@ -598,7 +598,7 @@ async def update_input(self, *, task_input: dict | TaskInput) -> dict:
598598
https://docs.apify.com/api/v2#/reference/actor-tasks/task-input-object/update-task-input
599599
600600
Args:
601-
task_input: The new default input for this task, as a dictionary or `TaskInput` model.
601+
task_input: The new default input for this task.
602602
603603
Returns:
604604
The updated task input.

src/apify_client/_resource_clients/task_collection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def create(
9696
in the task settings.
9797
restart_on_error: If true, the Task run process will be restarted whenever it exits with
9898
a non-zero status code.
99-
task_input: Task input object, as a dictionary or `TaskInput` model.
99+
task_input: Task input object.
100100
title: A human-friendly equivalent of the name.
101101
actor_standby_desired_requests_per_actor_run: The desired number of concurrent HTTP requests for
102102
a single Actor Standby run.
@@ -213,7 +213,7 @@ async def create(
213213
in the task settings.
214214
restart_on_error: If true, the Task run process will be restarted whenever it exits with
215215
a non-zero status code.
216-
task_input: Task input object, as a dictionary or `TaskInput` model.
216+
task_input: Task input object.
217217
title: A human-friendly equivalent of the name.
218218
actor_standby_desired_requests_per_actor_run: The desired number of concurrent HTTP requests for
219219
a single Actor Standby run.

0 commit comments

Comments
 (0)