airflow.exceptions

Exceptions used by Airflow.

Exceptions

AirflowException

Base class for all Airflow's errors.

AirflowBadRequest

Raise when the application or server cannot handle the request.

AirflowNotFoundException

Raise when the requested object/resource is not available in the system.

AirflowConfigException

Raise when there is configuration problem.

AirflowSensorTimeout

Raise when there is a timeout on sensor polling.

AirflowRescheduleException

Raise when the task should be re-scheduled at a later time.

InvalidStatsNameException

Raise when name of the stats is invalid.

AirflowTaskTimeout

Raise when the task execution times-out.

AirflowTaskTerminated

Raise when the task execution is terminated.

AirflowWebServerTimeout

Raise when the web server times out.

AirflowSkipException

Raise when the task should be skipped.

AirflowFailException

Raise when the task should be failed without retrying.

AirflowExecuteWithInactiveAssetExecption

Raise when the task is executed with inactive assets.

AirflowInactiveAssetInInletOrOutletException

Raise when the task is executed with inactive assets in its inlet or outlet.

AirflowInactiveAssetAddedToAssetAliasException

Raise when inactive assets are added to an asset alias.

AirflowOptionalProviderFeatureException

Raise by providers when imports are missing for optional provider features.

XComNotFound

Raise when an XCom reference is being resolved against a non-existent XCom.

XComForMappingNotPushed

Raise when a mapped downstream's dependency fails to push XCom for task mapping.

UnmappableXComTypePushed

Raise when an unmappable type is pushed as a mapped downstream's dependency.

UnmappableXComLengthPushed

Raise when the pushed value is too large to map as a downstream's dependency.

AirflowDagCycleException

Raise when there is a cycle in DAG definition.

AirflowDagDuplicatedIdException

Raise when a DAG's ID is already used by another DAG.

AirflowClusterPolicyViolation

Raise when there is a violation of a Cluster Policy in DAG definition.

AirflowClusterPolicySkipDag

Raise when skipping dag is needed in Cluster Policy.

AirflowClusterPolicyError

Raise for a Cluster Policy other than AirflowClusterPolicyViolation or AirflowClusterPolicySkipDag.

AirflowTimetableInvalid

Raise when a DAG has an invalid timetable.

DagNotFound

Raise when a DAG is not available in the system.

DagCodeNotFound

Raise when a DAG code is not available in the system.

DagRunNotFound

Raise when a DAG Run is not available in the system.

DagRunAlreadyExists

Raise when creating a DAG run for DAG which already has DAG run entry.

DagFileExists

Raise when a DAG ID is still in DagBag i.e., DAG file is in DAG folder.

FailFastDagInvalidTriggerRule

Raise when a dag has 'fail_fast' enabled yet has a non-default trigger rule.

DuplicateTaskIdFound

Raise when a Task with duplicate task_id is defined in the same DAG.

TaskAlreadyInTaskGroup

Raise when a Task cannot be added to a TaskGroup since it already belongs to another TaskGroup.

SerializationError

A problem occurred when trying to serialize something.

ParamValidationError

Raise when DAG params is invalid.

TaskNotFound

Raise when a Task is not available in the system.

TaskInstanceNotFound

Raise when a task instance is not available in the system.

PoolNotFound

Raise when a Pool is not available in the system.

AirflowFileParseException

Raises when connection or variable file can not be parsed.

ConnectionNotUnique

Raise when multiple values are found for the same connection ID.

TaskDeferred

Signal an operator moving to deferred state.

TaskDeferralError

Raised when a task failed during deferral for some reason.

TaskDeferralTimeout

Raise when there is a timeout on the deferral.

PodMutationHookException

Raised when exception happens during Pod Mutation Hook execution.

PodReconciliationError

Raised when an error is encountered while trying to merge pod configs.

RemovedInAirflow3Warning

Issued for usage of deprecated features that will be removed in Airflow3.

AirflowProviderDeprecationWarning

Issued for usage of deprecated features of Airflow provider.

DeserializingResultError

Raised when an error is encountered while a pickling library deserializes a pickle file.

UnknownExecutorException

Raised when an attempt is made to load an executor which is not configured.

Classes

FileSyntaxError

Information about a single error in a file.

Module Contents

exception airflow.exceptions.AirflowException[source]

Bases: Exception

Base class for all Airflow’s errors.

Each custom exception should be derived from this class.

status_code[source]
serialize()[source]
exception airflow.exceptions.AirflowBadRequest[source]

Bases: AirflowException

Raise when the application or server cannot handle the request.

status_code[source]
exception airflow.exceptions.AirflowNotFoundException[source]

Bases: AirflowException

Raise when the requested object/resource is not available in the system.

status_code[source]
exception airflow.exceptions.AirflowConfigException[source]

Bases: AirflowException

Raise when there is configuration problem.

exception airflow.exceptions.AirflowSensorTimeout[source]

Bases: AirflowException

Raise when there is a timeout on sensor polling.

exception airflow.exceptions.AirflowRescheduleException(reschedule_date)[source]

Bases: AirflowException

Raise when the task should be re-scheduled at a later time.

Parameters:

reschedule_date – The date when the task should be rescheduled

reschedule_date[source]
serialize()[source]
exception airflow.exceptions.InvalidStatsNameException[source]

Bases: AirflowException

Raise when name of the stats is invalid.

exception airflow.exceptions.AirflowTaskTimeout[source]

Bases: BaseException

Raise when the task execution times-out.

exception airflow.exceptions.AirflowTaskTerminated[source]

Bases: BaseException

Raise when the task execution is terminated.

exception airflow.exceptions.AirflowWebServerTimeout[source]

Bases: AirflowException

Raise when the web server times out.

exception airflow.exceptions.AirflowSkipException[source]

Bases: AirflowException

Raise when the task should be skipped.

exception airflow.exceptions.AirflowFailException[source]

Bases: AirflowException

Raise when the task should be failed without retrying.

exception airflow.exceptions.AirflowExecuteWithInactiveAssetExecption(inactive_asset_unikeys)[source]

Bases: AirflowFailException

Raise when the task is executed with inactive assets.

inactive_asset_unique_keys[source]
property inactive_assets_error_msg[source]
exception airflow.exceptions.AirflowInactiveAssetInInletOrOutletException(inactive_asset_unikeys)[source]

Bases: AirflowExecuteWithInactiveAssetExecption

Raise when the task is executed with inactive assets in its inlet or outlet.

__str__()[source]

Return str(self).

exception airflow.exceptions.AirflowInactiveAssetAddedToAssetAliasException(inactive_asset_unikeys)[source]

Bases: AirflowExecuteWithInactiveAssetExecption

Raise when inactive assets are added to an asset alias.

__str__()[source]

Return str(self).

exception airflow.exceptions.AirflowOptionalProviderFeatureException[source]

Bases: AirflowException

Raise by providers when imports are missing for optional provider features.

exception airflow.exceptions.XComNotFound(dag_id, task_id, key)[source]

Bases: AirflowException

Raise when an XCom reference is being resolved against a non-existent XCom.

dag_id[source]
task_id[source]
key[source]
__str__()[source]

Return str(self).

serialize()[source]
exception airflow.exceptions.XComForMappingNotPushed[source]

Bases: AirflowException

Raise when a mapped downstream’s dependency fails to push XCom for task mapping.

__str__()[source]

Return str(self).

exception airflow.exceptions.UnmappableXComTypePushed(value, *values)[source]

Bases: AirflowException

Raise when an unmappable type is pushed as a mapped downstream’s dependency.

__str__()[source]

Return str(self).

exception airflow.exceptions.UnmappableXComLengthPushed(value, max_length)[source]

Bases: AirflowException

Raise when the pushed value is too large to map as a downstream’s dependency.

value[source]
max_length[source]
__str__()[source]

Return str(self).

exception airflow.exceptions.AirflowDagCycleException[source]

Bases: AirflowException

Raise when there is a cycle in DAG definition.

exception airflow.exceptions.AirflowDagDuplicatedIdException(dag_id, incoming, existing)[source]

Bases: AirflowException

Raise when a DAG’s ID is already used by another DAG.

dag_id[source]
incoming[source]
existing[source]
__str__()[source]

Return str(self).

exception airflow.exceptions.AirflowClusterPolicyViolation[source]

Bases: AirflowException

Raise when there is a violation of a Cluster Policy in DAG definition.

exception airflow.exceptions.AirflowClusterPolicySkipDag[source]

Bases: AirflowException

Raise when skipping dag is needed in Cluster Policy.

exception airflow.exceptions.AirflowClusterPolicyError[source]

Bases: AirflowException

Raise for a Cluster Policy other than AirflowClusterPolicyViolation or AirflowClusterPolicySkipDag.

exception airflow.exceptions.AirflowTimetableInvalid[source]

Bases: AirflowException

Raise when a DAG has an invalid timetable.

exception airflow.exceptions.DagNotFound[source]

Bases: AirflowNotFoundException

Raise when a DAG is not available in the system.

exception airflow.exceptions.DagCodeNotFound[source]

Bases: AirflowNotFoundException

Raise when a DAG code is not available in the system.

exception airflow.exceptions.DagRunNotFound[source]

Bases: AirflowNotFoundException

Raise when a DAG Run is not available in the system.

exception airflow.exceptions.DagRunAlreadyExists(dag_run)[source]

Bases: AirflowBadRequest

Raise when creating a DAG run for DAG which already has DAG run entry.

dag_run[source]
serialize()[source]
exception airflow.exceptions.DagFileExists(*args, **kwargs)[source]

Bases: AirflowBadRequest

Raise when a DAG ID is still in DagBag i.e., DAG file is in DAG folder.

exception airflow.exceptions.FailFastDagInvalidTriggerRule[source]

Bases: AirflowException

Raise when a dag has ‘fail_fast’ enabled yet has a non-default trigger rule.

__str__()[source]

Return str(self).

exception airflow.exceptions.DuplicateTaskIdFound[source]

Bases: AirflowException

Raise when a Task with duplicate task_id is defined in the same DAG.

exception airflow.exceptions.TaskAlreadyInTaskGroup(task_id, existing_group_id, new_group_id)[source]

Bases: AirflowException

Raise when a Task cannot be added to a TaskGroup since it already belongs to another TaskGroup.

task_id[source]
existing_group_id[source]
new_group_id[source]
__str__()[source]

Return str(self).

exception airflow.exceptions.SerializationError[source]

Bases: AirflowException

A problem occurred when trying to serialize something.

exception airflow.exceptions.ParamValidationError[source]

Bases: AirflowException

Raise when DAG params is invalid.

exception airflow.exceptions.TaskNotFound[source]

Bases: AirflowNotFoundException

Raise when a Task is not available in the system.

exception airflow.exceptions.TaskInstanceNotFound[source]

Bases: AirflowNotFoundException

Raise when a task instance is not available in the system.

exception airflow.exceptions.PoolNotFound[source]

Bases: AirflowNotFoundException

Raise when a Pool is not available in the system.

class airflow.exceptions.FileSyntaxError[source]

Bases: NamedTuple

Information about a single error in a file.

line_no: int | None[source]
message: str[source]
__str__()[source]
exception airflow.exceptions.AirflowFileParseException(msg, file_path, parse_errors)[source]

Bases: AirflowException

Raises when connection or variable file can not be parsed.

Parameters:
  • msg (str) – The human-readable description of the exception

  • file_path (str) – A processed file that contains errors

  • parse_errors (list[FileSyntaxError]) – File syntax errors

msg[source]
file_path[source]
parse_errors[source]
__str__()[source]

Return str(self).

exception airflow.exceptions.ConnectionNotUnique[source]

Bases: AirflowException

Raise when multiple values are found for the same connection ID.

exception airflow.exceptions.TaskDeferred(*, trigger, method_name, kwargs=None, timeout=None)[source]

Bases: BaseException

Signal an operator moving to deferred state.

Special exception raised to signal that the operator it was raised from wishes to defer until a trigger fires. Triggers can send execution back to task or end the task instance directly. If the trigger should end the task instance itself, method_name does not matter, and can be None; otherwise, provide the name of the method that should be used when resuming execution in the task.

trigger[source]
method_name[source]
kwargs = None[source]
timeout: datetime.timedelta | None[source]
serialize()[source]
__repr__()[source]

Return repr(self).

exception airflow.exceptions.TaskDeferralError[source]

Bases: AirflowException

Raised when a task failed during deferral for some reason.

exception airflow.exceptions.TaskDeferralTimeout[source]

Bases: AirflowException

Raise when there is a timeout on the deferral.

exception airflow.exceptions.PodMutationHookException[source]

Bases: AirflowException

Raised when exception happens during Pod Mutation Hook execution.

exception airflow.exceptions.PodReconciliationError[source]

Bases: AirflowException

Raised when an error is encountered while trying to merge pod configs.

exception airflow.exceptions.RemovedInAirflow3Warning[source]

Bases: DeprecationWarning

Issued for usage of deprecated features that will be removed in Airflow3.

deprecated_since: str | None = None[source]

Indicates the airflow version that started raising this deprecation warning

exception airflow.exceptions.AirflowProviderDeprecationWarning[source]

Bases: DeprecationWarning

Issued for usage of deprecated features of Airflow provider.

deprecated_provider_since: str | None = None[source]

Indicates the provider version that started raising this deprecation warning

exception airflow.exceptions.DeserializingResultError[source]

Bases: ValueError

Raised when an error is encountered while a pickling library deserializes a pickle file.

__str__()[source]

Return str(self).

exception airflow.exceptions.UnknownExecutorException[source]

Bases: ValueError

Raised when an attempt is made to load an executor which is not configured.

Was this entry helpful?