uranusjr commented on a change in pull request #19355: URL: https://github.com/apache/airflow/pull/19355#discussion_r740892129
########## File path: airflow/example_dags/example_kubernetes_executor.py ########## @@ -18,86 +18,114 @@ """ This is an example dag for using the Kubernetes Executor. """ -import os +import logging from datetime import datetime from airflow import DAG from airflow.decorators import task from airflow.example_dags.libs.helper import print_stuff -with DAG( - dag_id='example_kubernetes_executor', - schedule_interval=None, - start_date=datetime(2021, 1, 1), - catchup=False, - tags=['example', 'example2'], -) as dag: - # You don't have to use any special KubernetesExecutor configuration if you don't want to - @task - def start_task(): - print_stuff() +log = logging.getLogger(__name__) - # But you can if you want to - kube_exec_config_special = {"KubernetesExecutor": {"image": "airflow/ci:latest"}} +try: + from kubernetes.client import models as k8s Review comment: Probably better to put everything under this line into the `else` block instead. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org