You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2021/04/05 11:41:47 UTC
[airflow] branch master updated: Bugfix: resources in
`executor_config` breaks Graph View in UI (#15199)
This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/master by this push:
new 7b577c3 Bugfix: resources in `executor_config` breaks Graph View in UI (#15199)
7b577c3 is described below
commit 7b577c35e241182f3f3473ca02da197f1b5f7437
Author: Kaxil Naik <ka...@gmail.com>
AuthorDate: Mon Apr 5 12:41:29 2021 +0100
Bugfix: resources in `executor_config` breaks Graph View in UI (#15199)
closes https://github.com/apache/airflow/issues/14327
When using `KubernetesExecutor` and the task as follows:
```python
PythonOperator(
task_id=f"sync_{table_name}",
python_callable=sync_table,
provide_context=True,
op_kwargs={"table_name": table_name},
executor_config={"KubernetesExecutor": {"request_cpu": "1"}},
retries=5,
dag=dag,
)
```
it breaks the UI as settings resources in such a way is only there
for backwards compatibility.
This commits fixes it.
---
airflow/utils/json.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/airflow/utils/json.py b/airflow/utils/json.py
index 45dda75..8e22408 100644
--- a/airflow/utils/json.py
+++ b/airflow/utils/json.py
@@ -66,7 +66,7 @@ class AirflowJsonEncoder(JSONEncoder):
obj, (np.float_, np.float16, np.float32, np.float64, np.complex_, np.complex64, np.complex128)
):
return float(obj)
- elif k8s is not None and isinstance(obj, k8s.V1Pod):
+ elif k8s is not None and isinstance(obj, (k8s.V1Pod, k8s.V1ResourceRequirements)):
from airflow.kubernetes.pod_generator import PodGenerator
return PodGenerator.serialize_pod(obj)