Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ dev = [
"pytest-timeout<3.0.0",
"pytest-xdist<4.0.0",
"pytest<10.0.0",
"ruff~=0.15.0",
"ruff~=0.16.0",
"setuptools", # setuptools are used by pytest but not explicitly required
"types-colorama<0.5.0",
"ty~=0.0.0",
Expand Down Expand Up @@ -101,6 +101,7 @@ ignore = [
"BLE001", # Do not catch blind exception
"C901", # `{name}` is too complex
"COM812", # This rule may cause conflicts when used with the formatter
"CPY001", # Missing copyright notice at top of file
"D100", # Missing docstring in public module
"D104", # Missing docstring in public package
"D107", # Missing docstring in `__init__`
Expand Down
8 changes: 4 additions & 4 deletions src/apify_client/_resource_clients/actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def update(
actor_standby_memory_mbytes: int | None = None,
pricing_infos: list[dict[str, Any]] | None = None,
actor_permission_level: ActorPermissionLevel | None = None,
tagged_builds: dict[str, None | dict[str, str]] | None = None,
tagged_builds: dict[str, dict[str, str] | None] | None = None,
timeout: Timeout = 'short',
) -> Actor:
"""Update the Actor with the specified fields.
Expand Down Expand Up @@ -305,7 +305,7 @@ def call(
webhooks: WebhooksList | None = None,
force_permission_level: ActorPermissionLevel | None = None,
wait_duration: timedelta | None = None,
logger: Logger | None | Literal['default'] = 'default',
logger: Logger | Literal['default'] | None = 'default',
timeout: Timeout = 'no_timeout',
) -> Run | None:
"""Start the Actor and wait for it to finish before returning the Run object.
Expand Down Expand Up @@ -620,7 +620,7 @@ async def update(
actor_standby_memory_mbytes: int | None = None,
pricing_infos: list[dict[str, Any]] | None = None,
actor_permission_level: ActorPermissionLevel | None = None,
tagged_builds: dict[str, None | dict[str, str]] | None = None,
tagged_builds: dict[str, dict[str, str] | None] | None = None,
timeout: Timeout = 'short',
) -> Actor:
"""Update the Actor with the specified fields.
Expand Down Expand Up @@ -801,7 +801,7 @@ async def call(
webhooks: WebhooksList | None = None,
force_permission_level: ActorPermissionLevel | None = None,
wait_duration: timedelta | None = None,
logger: Logger | None | Literal['default'] = 'default',
logger: Logger | Literal['default'] | None = 'default',
timeout: Timeout = 'no_timeout',
) -> Run | None:
"""Start the Actor and wait for it to finish before returning the Run object.
Expand Down
21 changes: 14 additions & 7 deletions tests/unit/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,22 @@
_MOCKED_ACTOR_NAME = 'mocked_actor_name'
_MOCKED_ACTOR_ID = 'mocked_actor_id'
_MOCKED_ACTOR_LOGS = (
b'2025-05-13T07:24:12.588Z ACTOR: Pulling Docker image of build.\n'
b'2025-05-13T07:24:12.686Z ACTOR: Creating Docker container.\n'
b'2025-05-13T07:24:12.745Z ACTOR: Starting Docker container.\n', # Several logs merged into one chunk
# Several logs merged into one chunk
(
b'2025-05-13T07:24:12.588Z ACTOR: Pulling Docker image of build.\n'
b'2025-05-13T07:24:12.686Z ACTOR: Creating Docker container.\n'
b'2025-05-13T07:24:12.745Z ACTOR: Starting Docker container.\n'
),
b'2025-05-13T07:26:14.132Z [apify] DEBUG \xc3', # Chunked log split in the middle of the multibyte character
b'\xa1\n', # part 2
b'2025-05-13T07:24:14.132Z [apify] INFO multiline \n log\n',
b'2025-05-13T07:25:14.132Z [apify] WARNING some warning\n',
b'2025-05-13T07:26:14.132Z [apify] DEBUG c\n',
b'2025-05-13T0', # Chunked log that got split in the marker
b'7:26:14.132Z [apify] DEBUG d\n' # part 2
b'2025-05-13T07:27:14.132Z [apify] DEB', # Chunked log that got split outside of marker
(
b'7:26:14.132Z [apify] DEBUG d\n' # part 2
b'2025-05-13T07:27:14.132Z [apify] DEB' # Chunked log that got split outside of marker
),
b'UG e\n', # part 2
# Already redirected message
b'2025-05-13T07:28:14.132Z [apify.redirect-logger runId:4U1oAnKau6jpzjUuA] -> 2025-05-13T07:27:14.132Z ACTOR:...\n',
Expand All @@ -61,8 +66,10 @@
('2025-05-13T07:26:14.132Z [apify] DEBUG d', logging.DEBUG),
('2025-05-13T07:27:14.132Z [apify] DEBUG e', logging.DEBUG),
(
'2025-05-13T07:28:14.132Z [apify.redirect-logger runId:4U1oAnKau6jpzjUuA] -> '
'2025-05-13T07:27:14.132Z ACTOR:...',
(
'2025-05-13T07:28:14.132Z [apify.redirect-logger runId:4U1oAnKau6jpzjUuA] -> '
'2025-05-13T07:27:14.132Z ACTOR:...'
),
logging.INFO,
),
)
Expand Down
44 changes: 22 additions & 22 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading