You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by hu...@apache.org on 2023/04/18 00:00:49 UTC
[airflow] branch fix/deferrable_k8s_pod_op created (now bdef8215a6)
This is an automated email from the ASF dual-hosted git repository.
husseinawala pushed a change to branch fix/deferrable_k8s_pod_op
in repository https://gitbox.apache.org/repos/asf/airflow.git
at bdef8215a6 restore convert_config_file_to_dict method and deprecate it
This branch includes the following new commits:
new bdef8215a6 restore convert_config_file_to_dict method and deprecate it
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[airflow] 01/01: restore convert_config_file_to_dict method and deprecate it
Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
husseinawala pushed a commit to branch fix/deferrable_k8s_pod_op
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit bdef8215a6d86e2d4975a2bebb43834c19f5b591
Author: Hussein Awala <hu...@awala.fr>
AuthorDate: Tue Apr 18 02:00:04 2023 +0200
restore convert_config_file_to_dict method and deprecate it
---
airflow/providers/cncf/kubernetes/operators/pod.py | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/airflow/providers/cncf/kubernetes/operators/pod.py b/airflow/providers/cncf/kubernetes/operators/pod.py
index 3ff63e0393..2505ffbe2b 100644
--- a/airflow/providers/cncf/kubernetes/operators/pod.py
+++ b/airflow/providers/cncf/kubernetes/operators/pod.py
@@ -20,6 +20,7 @@ from __future__ import annotations
import json
import logging
+import os
import re
import secrets
import string
@@ -559,6 +560,20 @@ class KubernetesPodOperator(BaseOperator):
)
self.invoke_defer_method()
+ def convert_config_file_to_dict(self):
+ """Converts passed config_file to dict format."""
+ warnings.warn(
+ "This method is deprecated and will be removed in a future version.",
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ config_file = self.config_file if self.config_file else os.environ.get(KUBE_CONFIG_ENV_VAR)
+ if config_file:
+ with open(config_file) as f:
+ self._config_dict = yaml.safe_load(f)
+ else:
+ self._config_dict = None
+
def invoke_defer_method(self):
"""Method to easily redefine triggers which are being used in child classes."""
trigger_start_time = utcnow()