Skip to content

API response is not being parsed by SDK #829

@LucasMagnum

Description

@LucasMagnum
Cell In[2], [line 13](vscode-notebook-cell:?execution_count=2&line=13)
      4 apify_client = ApifyClient(API_KEY)
      5 run_input = {
      6   "collectMessages": True,
      7   "profiles": [
   (...)     10   "scrapeLastNDays": 1
     11 }
---> [13](vscode-notebook-cell:?execution_count=2&line=13) run = apify_client.actor("GEHKCq8O4orlPjLFf").call(run_input=run_input)

File ~/projects/factiverse/BRENDA-server/.venv/lib/python3.11/site-packages/apify_client/_logging.py:142, in _injects_client_details_to_log_context.<locals>.wrapper(resource_client, *args, **kwargs)
    139 log_context.client_method.set(fun.__qualname__)  # ty: ignore[unresolved-attribute]
    140 log_context.resource_id.set(resource_client._resource_id)  # noqa: SLF001
--> [142](https://file+.vscode-resource.vscode-cdn.net/Users/lucasmagnum/projects/factiverse/BRENDA-server/~/projects/factiverse/BRENDA-server/.venv/lib/python3.11/site-packages/apify_client/_logging.py:142) return fun(resource_client, *args, **kwargs)

File ~/projects/factiverse/BRENDA-server/.venv/lib/python3.11/site-packages/apify_client/_resource_clients/actor.py:377, in ActorClient.call(self, run_input, content_type, build, max_items, max_total_charge_usd, restart_on_error, memory_mbytes, run_timeout, webhooks, force_permission_level, wait_duration, logger, timeout)
    374 if logger == 'default':
    375     logger = None
--> [377](https://file+.vscode-resource.vscode-cdn.net/Users/lucasmagnum/projects/factiverse/BRENDA-server/~/projects/factiverse/BRENDA-server/.venv/lib/python3.11/site-packages/apify_client/_resource_clients/actor.py:377) with run_client.get_status_message_watcher(to_logger=logger), run_client.get_streamed_log(to_logger=logger):
    378     return run_client.wait_for_finish(wait_duration=wait_duration)

File ~/projects/factiverse/BRENDA-server/.venv/lib/python3.11/site-packages/apify_client/_logging.py:142, in _injects_client_details_to_log_context.<locals>.wrapper(resource_client, *args, **kwargs)
    139 log_context.client_method.set(fun.__qualname__)  # ty: ignore[unresolved-attribute]
    140 log_context.resource_id.set(resource_client._resource_id)  # noqa: SLF001
--> [142](https://file+.vscode-resource.vscode-cdn.net/Users/lucasmagnum/projects/factiverse/BRENDA-server/~/projects/factiverse/BRENDA-server/.venv/lib/python3.11/site-packages/apify_client/_logging.py:142) return fun(resource_client, *args, **kwargs)

File ~/projects/factiverse/BRENDA-server/.venv/lib/python3.11/site-packages/apify_client/_resource_clients/run.py:454, in RunClient.get_status_message_watcher(self, to_logger, check_period, timeout)
    446 if actor_id:
    447     actor_client = self._client_registry.actor_client(
    448         resource_id=actor_id,
    449         base_url=self._base_url,
   (...)    452         client_registry=self._client_registry,
    453     )
--> [454](https://file+.vscode-resource.vscode-cdn.net/Users/lucasmagnum/projects/factiverse/BRENDA-server/~/projects/factiverse/BRENDA-server/.venv/lib/python3.11/site-packages/apify_client/_resource_clients/run.py:454)     actor_data = actor_client.get(timeout=timeout)
    455 actor_name = actor_data.name if actor_data else ''
    457 if not to_logger:

File ~/projects/factiverse/BRENDA-server/.venv/lib/python3.11/site-packages/apify_client/_logging.py:142, in _injects_client_details_to_log_context.<locals>.wrapper(resource_client, *args, **kwargs)
    139 log_context.client_method.set(fun.__qualname__)  # ty: ignore[unresolved-attribute]
    140 log_context.resource_id.set(resource_client._resource_id)  # noqa: SLF001
--> [142](https://file+.vscode-resource.vscode-cdn.net/Users/lucasmagnum/projects/factiverse/BRENDA-server/~/projects/factiverse/BRENDA-server/.venv/lib/python3.11/site-packages/apify_client/_logging.py:142) return fun(resource_client, *args, **kwargs)

File ~/projects/factiverse/BRENDA-server/.venv/lib/python3.11/site-packages/apify_client/_resource_clients/actor.py:101, in ActorClient.get(self, timeout)
     99 if result is None:
    100     return None
--> [101](https://file+.vscode-resource.vscode-cdn.net/Users/lucasmagnum/projects/factiverse/BRENDA-server/~/projects/factiverse/BRENDA-server/.venv/lib/python3.11/site-packages/apify_client/_resource_clients/actor.py:101) return ActorResponse.model_validate(result).data

File ~/projects/factiverse/BRENDA-server/.venv/lib/python3.11/site-packages/pydantic/main.py:716, in BaseModel.model_validate(cls, obj, strict, extra, from_attributes, context, by_alias, by_name)
    710 if by_alias is False and by_name is not True:
    711     raise PydanticUserError(
    712         'At least one of `by_alias` or `by_name` must be set to True.',
    713         code='validate-by-alias-and-name-false',
    714     )
--> [716](https://file+.vscode-resource.vscode-cdn.net/Users/lucasmagnum/projects/factiverse/BRENDA-server/~/projects/factiverse/BRENDA-server/.venv/lib/python3.11/site-packages/pydantic/main.py:716) return cls.__pydantic_validator__.validate_python(
    717     obj,
    718     strict=strict,
    719     extra=extra,
    720     from_attributes=from_attributes,
    721     context=context,
    722     by_alias=by_alias,
    723     by_name=by_name,
    724 )


ValidationError: 5 validation errors for ActorResponse
data.pricingInfos.1.PAY_PER_EVENT.pricingPerEvent.actorChargeEvents.result.eventPriceUsd
  Field required [type=missing, input_value={'eventTitle': 'Result', ...ventPriceUsd': 0.0005}}}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.12/v/missing
data.pricingInfos.2.PAY_PER_EVENT.pricingPerEvent.actorChargeEvents.result.eventPriceUsd
  Field required [type=missing, input_value={'eventTitle': 'Result', ...ventPriceUsd': 0.0005}}}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.12/v/missing
data.pricingInfos.2.PAY_PER_EVENT.pricingPerEvent.actorChargeEvents.start.eventPriceUsd
  Field required [type=missing, input_value={'eventTitle': 'Start Run... 'isOneTimeEvent': True}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.12/v/missing
data.pricingInfos.3.PAY_PER_EVENT.pricingPerEvent.actorChargeEvents.result.eventPriceUsd
  Field required [type=missing, input_value={'eventTitle': 'Result', ... 'isPrimaryEvent': True}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.12/v/missing
d```

Metadata

Metadata

Assignees

Labels

bugSomething isn't working.t-toolingIssues with this label are in the ownership of the tooling team.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions