Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: better types #18

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading