ashb commented on a change in pull request #10393:
URL: https://github.com/apache/airflow/pull/10393#discussion_r481271072
##########
File path: airflow/utils/json.py
##########
@@ -20,6 +20,7 @@
from datetime import date, datetime
import numpy as np
+from kubernetes.client import models as k8s
Review comment:
```suggestion
try:
from kubernetes.client import models as k8s
except ImportError:
k8s = None
```
##########
File path: airflow/utils/json.py
##########
@@ -50,5 +51,8 @@ def _default(obj):
elif isinstance(obj, (np.float_, np.float16, np.float32, np.float64,
np.complex_, np.complex64, np.complex128)):
return float(obj)
+ elif isinstance(obj, k8s.V1Pod):
Review comment:
```suggestion
elif k8s is not None and isinstance(obj, k8s.V1Pod):
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]