airflow.providers.anthropic.sensors.batch¶
Classes¶
Wait for an already-submitted Anthropic Message Batch to reach a terminal status. |
Module Contents¶
- class airflow.providers.anthropic.sensors.batch.AnthropicBatchSensor(*, batch_id, conn_id=AnthropicHook.default_conn_name, deferrable=conf.getboolean('operators', 'default_deferrable', fallback=False), fail_on_partial_error=False, **kwargs)[source]¶
Bases:
airflow.providers.common.compat.sdk.BaseSensorOperatorWait for an already-submitted Anthropic Message Batch to reach a terminal status.
Pairs with
AnthropicBatchOperator(wait_for_completion=False)(or any out-of-band submission) for a fire-and-forget submit + re-entrant await. Because the sensor only polls an existingbatch_id, it is naturally idempotent across retries — unlike a submit step, retrying it never creates a new batch.On a terminal batch it applies the same policy as the operator: a fully-cancelled batch skips the task, and
fail_on_partial_errorcontrols whether errored/expired requests fail it.See also
For more information, take a look at the guide: AnthropicBatchSensor
- Parameters:
batch_id (str) – The ID of the batch to wait for.
conn_id (str) – The Anthropic connection ID to use.
deferrable (bool) – Run the sensor in deferrable mode (polls via a trigger).
fail_on_partial_error (bool) – If
True, fail when any request errored or expired. Defaults toFalse(succeed and log a warning).
- template_fields: collections.abc.Sequence[str] = ('batch_id',)[source]¶
- property hook: airflow.providers.anthropic.hooks.anthropic.AnthropicHook[source]¶
Return an instance of the AnthropicHook.