You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/12/21 08:29:41 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #28509: Present nicer error message when cncf provider is missing

uranusjr commented on code in PR #28509:
URL: https://github.com/apache/airflow/pull/28509#discussion_r1054104305


##########
airflow/providers/amazon/aws/operators/eks.py:
##########
@@ -26,7 +26,15 @@
 from airflow import AirflowException
 from airflow.models import BaseOperator
 from airflow.providers.amazon.aws.hooks.eks import EksHook
-from airflow.providers.cncf.kubernetes.operators.kubernetes_pod import KubernetesPodOperator
+
+try:
+    from airflow.providers.cncf.kubernetes.operators.kubernetes_pod import KubernetesPodOperator
+except ImportError:
+
+    raise AirflowException(
+        "apache-airflow-providers-cncf-kubernetes not installed, run: "
+        "pip install 'apache-airflow-providers-amazon[cncf.kubernetes]'"
+    )

Review Comment:
   Can be made cleaner with `raise ... from None` to suppress the original ImportError



-- 
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-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org