airflow.exceptions

Exceptions used by Airflow.

Exceptions

AirflowException

Base exception for Airflow errors.

AirflowBadRequest

Raise when the application or server cannot handle the request.

InvalidStatsNameException

Raise when name of the stats is invalid.

AirflowOptionalProviderFeatureException

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

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.

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.

SerializationError

A problem occurred when trying to serialize something.

TaskInstanceNotFound

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

NotMapped

Raise if a task is neither mapped nor has any parent mapped groups.

PoolNotFound

Raise when a Pool is not available in the system.

AirflowFileParseException

Raises when connection or variable file can not be parsed.

AirflowUnsupportedFileTypeException

Raise when a file type is not supported.

ConnectionNotUnique

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

VariableNotUnique

Raise when multiple values are found for the same variable name.

PodMutationHookException

Raised when exception happens during Pod Mutation Hook execution.

PodReconciliationError

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

RemovedInAirflow4Warning

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

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.

DeserializationError

Raised when a Dag cannot be deserialized.

AirflowClearRunningTaskException

Raise when the user attempts to clear currently running tasks.

Classes

FileSyntaxError

Information about a single error in a file.

Functions

__getattr__(name)

Provide backward compatibility for moved exceptions.

Module Contents

exception airflow.exceptions.AirflowException[source]

Bases: Exception

Base exception for Airflow errors.

exception airflow.exceptions.AirflowBadRequest[source]

Bases: airflow.sdk.exceptions.AirflowException

Raise when the application or server cannot handle the request.

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

Bases: airflow.sdk.exceptions.AirflowException

Raise when name of the stats is invalid.

exception airflow.exceptions.AirflowOptionalProviderFeatureException[source]

Bases: airflow.sdk.exceptions.AirflowException

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

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

Bases: airflow.sdk.exceptions.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: airflow.sdk.exceptions.AirflowException

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

exception airflow.exceptions.AirflowClusterPolicySkipDag[source]

Bases: airflow.sdk.exceptions.AirflowException

Raise when skipping dag is needed in Cluster Policy.

exception airflow.exceptions.AirflowClusterPolicyError[source]

Bases: airflow.sdk.exceptions.AirflowException

Raise for a Cluster Policy other than AirflowClusterPolicyViolation or AirflowClusterPolicySkipDag.

exception airflow.exceptions.DagNotFound[source]

Bases: airflow.sdk.exceptions.AirflowNotFoundException

Raise when a DAG is not available in the system.

exception airflow.exceptions.DagCodeNotFound[source]

Bases: airflow.sdk.exceptions.AirflowNotFoundException

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

exception airflow.exceptions.DagRunNotFound[source]

Bases: airflow.sdk.exceptions.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.SerializationError[source]

Bases: airflow.sdk.exceptions.AirflowException

A problem occurred when trying to serialize something.

exception airflow.exceptions.TaskInstanceNotFound[source]

Bases: airflow.sdk.exceptions.AirflowNotFoundException

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

exception airflow.exceptions.NotMapped[source]

Bases: Exception

Raise if a task is neither mapped nor has any parent mapped groups.

exception airflow.exceptions.PoolNotFound[source]

Bases: airflow.sdk.exceptions.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: airflow.sdk.exceptions.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.AirflowUnsupportedFileTypeException[source]

Bases: airflow.sdk.exceptions.AirflowException

Raise when a file type is not supported.

exception airflow.exceptions.ConnectionNotUnique[source]

Bases: airflow.sdk.exceptions.AirflowException

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

exception airflow.exceptions.VariableNotUnique[source]

Bases: airflow.sdk.exceptions.AirflowException

Raise when multiple values are found for the same variable name.

exception airflow.exceptions.PodMutationHookException[source]

Bases: airflow.sdk.exceptions.AirflowException

Raised when exception happens during Pod Mutation Hook execution.

exception airflow.exceptions.PodReconciliationError[source]

Bases: airflow.sdk.exceptions.AirflowException

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

exception airflow.exceptions.RemovedInAirflow4Warning[source]

Bases: DeprecationWarning

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

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.

exception airflow.exceptions.DeserializationError(dag_id=None, message=None)[source]

Bases: Exception

Raised when a Dag cannot be deserialized.

This exception should be raised using exception chaining: raise DeserializationError(dag_id) from original_exception

dag_id = None[source]
exception airflow.exceptions.AirflowClearRunningTaskException[source]

Bases: airflow.sdk.exceptions.AirflowException

Raise when the user attempts to clear currently running tasks.

airflow.exceptions.__getattr__(name)[source]

Provide backward compatibility for moved exceptions.

Was this entry helpful?