Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
svallero committed Jan 18, 2024
1 parent 9b9aea1 commit 5cdf172
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions kubernetes_airflow_dag_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,20 @@

log = logging.getLogger(__name__)

worker_container_repository = conf.get("kubernetes_executor", "worker_container_repository")
worker_container_repository = conf.get(
"kubernetes_executor", "worker_container_repository"
)
worker_container_tag = conf.get("kubernetes_executor", "worker_container_tag")

try:
from kubernetes.client import models as k8s
except ImportError:
log.warning("Could not import DAGs in example_local_kubernetes_executor.py", exc_info=True)
log.warning("Install Kubernetes dependencies with: pip install apache-airflow[cncf.kubernetes]")
log.warning(
"Could not import DAGs in example_local_kubernetes_executor.py", exc_info=True
)
log.warning(
"Install Kubernetes dependencies with: pip install apache-airflow[cncf.kubernetes]"
)
k8s = None

if k8s:
Expand All @@ -50,7 +56,9 @@
) as dag:
# You can use annotations on your kubernetes pods!
start_task_executor_config = {
"pod_override": k8s.V1Pod(metadata=k8s.V1ObjectMeta(annotations={"test": "annotation"}))
"pod_override": k8s.V1Pod(
metadata=k8s.V1ObjectMeta(annotations={"test": "annotation"})
)
}

@task(
Expand Down

0 comments on commit 5cdf172

Please sign in to comment.