Skip to content

Commit

Permalink
static checks fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
o-nikolas committed Jul 11, 2023
1 parent fd55406 commit 33b4cd1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 4 additions & 5 deletions airflow/executors/kubernetes_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def _list_pods(self, query_kwargs):
def _make_safe_label_value(self, input_value: str | datetime) -> str:
"""
Normalize a provided label to be of valid length and characters.
See airflow.kubernetes.pod_generator.make_safe_label_value for more details
See airflow.kubernetes.pod_generator.make_safe_label_value for more details.
"""
# airflow.kubernetes is an expensive import, locally import it here to
# speed up load times of the kubernetes_executor module.
Expand Down Expand Up @@ -169,9 +169,9 @@ def clear_not_launched_queued_tasks(self, session: Session = NEW_SESSION) -> Non
if pod_list:
continue
# Fallback to old style of using execution_date
kwargs["label_selector"] = (
f"{base_label_selector}," f"execution_date={self._make_safe_label_value(ti.execution_date)}"
)
kwargs[
"label_selector"
] = f"{base_label_selector},execution_date={self._make_safe_label_value(ti.execution_date)}"
pod_list = self._list_pods(kwargs)
if pod_list:
continue
Expand Down Expand Up @@ -347,7 +347,6 @@ def _change_state(
) -> None:
if TYPE_CHECKING:
assert self.kube_scheduler
from airflow.models.taskinstance import TaskInstance

if state == State.RUNNING:
self.event_buffer[key] = state, None
Expand Down
1 change: 1 addition & 0 deletions airflow/kubernetes/kubernetes_helper_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

from airflow.compat.functools import cache
from airflow.configuration import conf

if TYPE_CHECKING:
from airflow.models.taskinstancekey import TaskInstanceKey

Expand Down

0 comments on commit 33b4cd1

Please sign in to comment.