kaxil commented on a change in pull request #10084:
URL: https://github.com/apache/airflow/pull/10084#discussion_r466548177
##########
File path: airflow/kubernetes/pod_generator.py
##########
@@ -637,6 +640,37 @@ def extend_object_field(base_obj, client_obj, field_name):
setattr(client_obj_cp, field_name, base_obj_field)
return client_obj_cp
- appended_fields = base_obj_field + client_obj_field
+ base_obj_set = get_dict_from_list(base_obj_field)
+ client_obj_set = get_dict_from_list(client_obj_field)
+
+ appended_fields = _merge_list_of_objects(base_obj_set, client_obj_set)
+
setattr(client_obj_cp, field_name, appended_fields)
return client_obj_cp
+
+
+def _merge_list_of_objects(base_obj_set, client_obj_set):
+ for k, v in base_obj_set.items():
+ if k not in client_obj_set:
+ client_obj_set[k] = v
+ else:
+ client_obj_set[k] = merge_objects(v, client_obj_set[k])
+ appended_field_keys = sorted(client_obj_set.keys())
+ appended_fields = [client_obj_set[k] for k in appended_field_keys]
+ return appended_fields
+
+
+def get_dict_from_list(base_list):
+ """
+ :param base_list:
+ :type base_list: list(Optional[dict,
Review comment:
We need to fix this or remove the type and make it an internal Method
----------------------------------------------------------------
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]