We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a02e27 commit 2049fc7Copy full SHA for 2049fc7
packages/dask-task-models-library/src/dask_task_models_library/resource_constraints.py
@@ -1,8 +1,13 @@
1
-from typing import Any, TypeAlias
+from typing import Literal, TypedDict
2
3
from .constants import DASK_TASK_EC2_RESOURCE_RESTRICTION_KEY
4
5
-DaskTaskResources: TypeAlias = dict[str, Any]
+
6
+class DaskTaskResources(TypedDict):
7
+ CPU: float
8
+ RAM: int # in bytes
9
+ # threads is a constant of 1 (enforced by static type checkers via Literal)
10
+ threads: Literal[1]
11
12
13
def create_ec2_resource_constraint_key(ec2_instance_type: str) -> str:
0 commit comments