Skip to content

Commit

Permalink
fix static checks
Browse files Browse the repository at this point in the history
  • Loading branch information
bbenzikry committed Jul 27, 2020
1 parent af4b73a commit 4990b29
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
3 changes: 2 additions & 1 deletion airflow/providers/cncf/kubernetes/hooks/kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def create_custom_resource_definition(
def get_pod_log_stream(
self,
pod_name: str,
container: Optional[str] = "base",
container: Optional[str] = "",
namespace: Optional[str] = None,
) -> Tuple[watch.Watch, Generator[str, None, None]]:
"""
Expand All @@ -130,6 +130,7 @@ def get_pod_log_stream(
watcher.stream(
api.read_namespaced_pod_log,
name=pod_name,
container=container,
namespace=namespace if namespace else self.get_namespace(),
),
)
Expand Down
9 changes: 3 additions & 6 deletions airflow/providers/cncf/kubernetes/sensors/spark_kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,9 @@ def _log_driver(self, application_state: str):
self.log.warning(
"Could not read logs for pod %s. It may have been disposed.\n"
"Make sure timeToLiveSeconds is set on your SparkApplication spec.\n"
"underlying exception: %s" % (driver_pod_name, e)
)
except Exception as e:
self.log.warning(
"Unexpected error while reading logs for pod %s. error: %s"
% (driver_pod_name, e)
"underlying exception: %s",
driver_pod_name,
e,
)

def poke(self, context: Dict):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
from airflow import DAG
from airflow.exceptions import AirflowException
from airflow.models import Connection
from airflow.providers.cncf.kubernetes.sensors.spark_kubernetes import (
SparkKubernetesSensor,
)
from airflow.providers.cncf.kubernetes.sensors.spark_kubernetes import SparkKubernetesSensor
from airflow.utils import db, timezone

TEST_COMPLETED_APPLICATION = {
Expand Down

0 comments on commit 4990b29

Please sign in to comment.