feluelle commented on a change in pull request #5786: [AIRFLOW-5170] Fix
encoding pragmas, consistent licences for python files and related pylint fixes
URL: https://github.com/apache/airflow/pull/5786#discussion_r314901359
##########
File path: airflow/kubernetes/pod_launcher.py
##########
@@ -14,36 +16,48 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-
+"""Launches PODs"""
import json
import time
-import tenacity
from typing import Tuple, Optional
+from datetime import datetime as dt
+from requests.exceptions import BaseHTTPError
+
+import tenacity
+
+from kubernetes import watch, client
+from kubernetes.client.rest import ApiException
+from kubernetes.stream import stream as kubernetes_stream
from airflow.settings import pod_mutation_hook
from airflow.utils.log.logging_mixin import LoggingMixin
from airflow.utils.state import State
-from datetime import datetime as dt
from airflow.kubernetes.pod import Pod
from airflow.kubernetes.kubernetes_request_factory import pod_request_factory
as pod_factory
-from kubernetes import watch, client
-from kubernetes.client.rest import ApiException
-from kubernetes.stream import stream as kubernetes_stream
from airflow import AirflowException
-from requests.exceptions import BaseHTTPError
+
from .kube_client import get_kube_client
class PodStatus:
+ """Status of the PODs"""
PENDING = 'pending'
RUNNING = 'running'
FAILED = 'failed'
SUCCEEDED = 'succeeded'
class PodLauncher(LoggingMixin):
+ """Launches PODS"""
def __init__(self, kube_client=None, in_cluster=True, cluster_context=None,
extract_xcom=False):
+ """
+ Creates the launcher
Review comment:
plus empty line and `type` either by adding it to the docs or directly in
the `__init__` args itself (mypy).
----------------------------------------------------------------
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]
With regards,
Apache Git Services