Skip to content

fix: Fix return type of charge API call #350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/apify_client/clients/resource_clients/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def charge(
event_name: str,
count: int | None = None,
idempotency_key: str | None = None,
) -> dict:
) -> None:
"""Charge for an event of a Pay-Per-Event Actor run.

https://docs.apify.com/api/v2#/reference/actor-runs/charge-events-in-run
Expand All @@ -248,7 +248,7 @@ def charge(
or f'{self.resource_id}-{event_name}-{int(time.time() * 1000)}-{"".join(random.choices(string.ascii_letters + string.digits, k=6))}' # noqa: E501
)

response = self.http_client.call(
self.http_client.call(
url=self._url('charge'),
method='POST',
headers={
Expand All @@ -262,7 +262,6 @@ def charge(
}
),
)
return parse_date_fields(pluck_data(response.json()))


class RunClientAsync(ActorJobBaseClientAsync):
Expand Down Expand Up @@ -486,7 +485,7 @@ async def charge(
event_name: str,
count: int | None = None,
idempotency_key: str | None = None,
) -> dict:
) -> None:
"""Charge for an event of a Pay-Per-Event Actor run.

https://docs.apify.com/api/v2#/reference/actor-runs/charge-events-in-run
Expand All @@ -501,7 +500,7 @@ async def charge(
f'{self.resource_id}-{event_name}-{int(time.time() * 1000)}-{"".join(random.choices(string.ascii_letters + string.digits, k=6))}' # noqa: E501
)

response = await self.http_client.call(
await self.http_client.call(
url=self._url('charge'),
method='POST',
headers={
Expand All @@ -515,4 +514,3 @@ async def charge(
}
),
)
return parse_date_fields(pluck_data(response.json()))
Loading