Skip to content

Commit

Permalink
chore: better types (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
ion-elgreco authored Jan 22, 2025
1 parent bd47e0a commit c450599
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion dagster_uc/manage_user_code_deployments.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import subprocess
import time
from dataclasses import asdict
from typing import Annotated
from typing import Annotated, cast

import kr8s
import typer
Expand Down Expand Up @@ -317,6 +317,7 @@ def check_deployment(
label_selector=f"deployment={name}",
namespace=config.namespace,
):
pod = cast(Pod, pod)
with contextlib.suppress(Exception):
for line in pod.logs(pretty=True, follow=True, timeout=timeout): # type: ignore
typer.echo(line)
Expand Down
6 changes: 3 additions & 3 deletions dagster_uc/uc_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def remove_all_deployments(self) -> None:
configmap = self._read_namespaced_config_map(
self.config.user_code_deployments_configmap_name,
)
configmap.patch(dagster_user_deployments_values_yaml_configmap) # type: ignore
configmap.patch(dagster_user_deployments_values_yaml_configmap)

def list_deployments(
self,
Expand Down Expand Up @@ -240,7 +240,7 @@ def delete_k8s_resources_for_user_deployment(
namespace=self.config.namespace,
):
logger.info(f"Deleting pod {pod.name}")
pod.delete() # type: ignore
pod.delete()

if delete_deployments:
import contextlib
Expand Down Expand Up @@ -499,7 +499,7 @@ def delete_k8s_resources(self, label_selector: str):
namespace=self.config.namespace,
label_selector=label_selector,
):
item.delete() # type: ignore
item.delete()

def acquire_semaphore(self, reset_lock: bool = False) -> bool:
"""Acquires a semaphore by creating a configmap"""
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ classifiers = [
"Programming Language :: Python :: 3.13"
]
dependencies = [
"kr8s>=0.20,<1.0",
"pyhelm3==0.3.3",
"typer==0.12.3",
"kr8s>=0.20.1,<1.0",
"pyhelm3>=0.3.3",
"typer>=0.15.1",
"tomli",
"pyyaml",
"pytz"
Expand Down

0 comments on commit c450599

Please sign in to comment.