Skip to content

Commit ebc1687

Browse files
committed
Clarify docstring
1 parent f7c56c4 commit ebc1687

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/apify/_actor.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -462,13 +462,14 @@ async def open_request_queue(
462462
@overload
463463
async def push_data(self, data: dict | list[dict]) -> None: ...
464464
@overload
465-
async def push_data(self, data: dict | list[dict], event_name: str) -> ChargeResult: ...
466-
async def push_data(self, data: dict | list[dict], event_name: str | None = None) -> ChargeResult | None:
465+
async def push_data(self, data: dict | list[dict], charged_event_name: str) -> ChargeResult: ...
466+
async def push_data(self, data: dict | list[dict], charged_event_name: str | None = None) -> ChargeResult | None:
467467
"""Store an object or a list of objects to the default dataset of the current Actor run.
468468
469469
Args:
470470
data: The data to push to the default dataset.
471-
event_name: If provided, the method will attempt to charge for the event for each pushed item.
471+
charged_event_name: If provided and if the Actor uses the pay-per-event pricing model,
472+
the method will attempt to charge for the event for each pushed item.
472473
"""
473474
self._raise_if_not_initialized()
474475

@@ -478,8 +479,8 @@ async def push_data(self, data: dict | list[dict], event_name: str | None = None
478479
data = data if isinstance(data, list) else [data]
479480

480481
max_charged_count = (
481-
self._charging_manager.calculate_max_event_charge_count_within_limit(event_name)
482-
if event_name is not None
482+
self._charging_manager.calculate_max_event_charge_count_within_limit(charged_event_name)
483+
if charged_event_name is not None
483484
else None
484485
)
485486

@@ -491,9 +492,9 @@ async def push_data(self, data: dict | list[dict], event_name: str | None = None
491492
else:
492493
await dataset.push_data(data)
493494

494-
if event_name:
495+
if charged_event_name:
495496
return await self._charging_manager.charge(
496-
event_name=event_name,
497+
event_name=charged_event_name,
497498
count=min(max_charged_count, len(data)) if max_charged_count is not None else len(data),
498499
)
499500

0 commit comments

Comments
 (0)