Skip to content

Commit

Permalink
Fix static check error
Browse files Browse the repository at this point in the history
  • Loading branch information
XD-DENG committed Dec 3, 2022
1 parent f4d83e0 commit a23c33e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions airflow/executors/kubernetes_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ResourceVersion:
"""Singleton for tracking resourceVersion from Kubernetes"""

_instance = None
resource_version: dict[str | None, str | None] = {}
resource_version: dict[str | None, str] = {}

def __new__(cls):
if cls._instance is None:
Expand Down Expand Up @@ -635,7 +635,7 @@ def sync(self) -> None:
self.log.debug("self.queued: %s", self.queued_tasks)
self.kube_scheduler.sync()

last_resource_version = defaultdict(lambda: "0")
last_resource_version: dict[str | None, str] = defaultdict(lambda: "0")
while True:
try:
results = self.result_queue.get_nowait()
Expand All @@ -659,9 +659,9 @@ def sync(self) -> None:
break

resource_instance = ResourceVersion()
for namespace in resource_instance.resource_version.keys():
resource_instance.resource_version[namespace] = (
last_resource_version[namespace] or resource_instance.resource_version[namespace]
for ns in resource_instance.resource_version.keys():
resource_instance.resource_version[ns] = (
last_resource_version[ns] or resource_instance.resource_version[ns]
)

for _ in range(self.kube_config.worker_pods_creation_batch_size):
Expand Down

0 comments on commit a23c33e

Please sign in to comment.