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
6 changes: 6 additions & 0 deletions docs/apache-airflow/concepts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,12 @@ Here is what it may look like:
:start-after: [START example_dag_cluster_policy]
:end-before: [END example_dag_cluster_policy]


.. note::

To avoid import cycles, if using ``DAG`` in type annotations in your cluster policy, be sure to import from ``airflow.models`` and not from ``airflow``.


Task level cluster policy
-----------------------------
For example, this function could apply a specific queue property when
Expand Down
3 changes: 1 addition & 2 deletions tests/cluster_policies/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
from datetime import timedelta
from typing import Callable, List

from airflow import DAG
from airflow.configuration import conf
from airflow.exceptions import AirflowClusterPolicyViolation
from airflow.models import TaskInstance
from airflow.models import DAG, TaskInstance
from airflow.models.baseoperator import BaseOperator


Expand Down