22
33from dstack ._internal .core .compatibility .common import get_profile_excludes
44from dstack ._internal .core .models .common import (
5- IncludeExcludeDictType ,
65 IncludeExcludeSetType ,
6+ IncludeExcludeStrDictType ,
77)
88from dstack ._internal .core .models .configurations import (
99 ServiceConfiguration ,
@@ -24,19 +24,19 @@ def get_list_runs_excludes(list_runs_request: ListRunsRequest) -> IncludeExclude
2424 return excludes
2525
2626
27- def get_apply_plan_excludes (plan : ApplyRunPlanInput ) -> Optional [IncludeExcludeDictType ]:
27+ def get_apply_plan_excludes (plan : ApplyRunPlanInput ) -> Optional [IncludeExcludeStrDictType ]:
2828 """
2929 Returns `plan` exclude mapping to exclude certain fields from the request.
3030 Use this method to exclude new fields when they are not set to keep
3131 clients backward-compatibility with older servers.
3232 """
33- apply_plan_excludes : IncludeExcludeDictType = {}
33+ apply_plan_excludes : IncludeExcludeStrDictType = {}
3434 run_spec_excludes = get_run_spec_excludes (plan .run_spec )
3535 if run_spec_excludes is not None :
3636 apply_plan_excludes ["run_spec" ] = run_spec_excludes
3737 current_resource = plan .current_resource
3838 if current_resource is not None :
39- current_resource_excludes : IncludeExcludeDictType = {}
39+ current_resource_excludes : IncludeExcludeStrDictType = {}
4040 apply_plan_excludes ["current_resource" ] = current_resource_excludes
4141 current_resource_excludes ["run_spec" ] = get_run_spec_excludes (current_resource .run_spec )
4242 current_resource_excludes ["jobs" ] = {
@@ -62,12 +62,12 @@ def get_apply_plan_excludes(plan: ApplyRunPlanInput) -> Optional[IncludeExcludeD
6262 return {"plan" : apply_plan_excludes }
6363
6464
65- def get_get_plan_excludes (request : GetRunPlanRequest ) -> Optional [IncludeExcludeDictType ]:
65+ def get_get_plan_excludes (request : GetRunPlanRequest ) -> Optional [IncludeExcludeStrDictType ]:
6666 """
6767 Excludes new fields when they are not set to keep
6868 clients backward-compatibility with older servers.
6969 """
70- get_plan_excludes : IncludeExcludeDictType = (
70+ get_plan_excludes : IncludeExcludeStrDictType = (
7171 {} if request .reverse_offers else {"reverse_offers" : True }
7272 )
7373 run_spec_excludes = get_run_spec_excludes (request .run_spec )
@@ -76,14 +76,14 @@ def get_get_plan_excludes(request: GetRunPlanRequest) -> Optional[IncludeExclude
7676 return get_plan_excludes
7777
7878
79- def get_run_spec_excludes (run_spec : RunSpec ) -> IncludeExcludeDictType :
79+ def get_run_spec_excludes (run_spec : RunSpec ) -> IncludeExcludeStrDictType :
8080 """
8181 Returns `run_spec` exclude mapping to exclude certain fields from the request.
8282 Use this method to exclude new fields when they are not set to keep
8383 clients backward-compatibility with older servers.
8484 """
85- spec_excludes : IncludeExcludeDictType = {}
86- configuration_excludes : IncludeExcludeDictType = {}
85+ spec_excludes : IncludeExcludeStrDictType = {}
86+ configuration_excludes : IncludeExcludeStrDictType = {}
8787 profile_excludes = get_profile_excludes (run_spec .profile )
8888 for field in get_profile_excludes (run_spec .configuration ):
8989 configuration_excludes [field ] = True
@@ -106,13 +106,13 @@ def get_run_spec_excludes(run_spec: RunSpec) -> IncludeExcludeDictType:
106106 return spec_excludes
107107
108108
109- def get_job_spec_excludes (job_specs : list [JobSpec ]) -> IncludeExcludeDictType :
109+ def get_job_spec_excludes (job_specs : list [JobSpec ]) -> IncludeExcludeStrDictType :
110110 """
111111 Returns `job_spec` exclude mapping to exclude certain fields from the request.
112112 Use this method to exclude new fields when they are not set to keep
113113 clients backward-compatibility with older servers.
114114 """
115- spec_excludes : IncludeExcludeDictType = {}
115+ spec_excludes : IncludeExcludeStrDictType = {}
116116 if all (s .node_group_index == 0 for s in job_specs ):
117117 spec_excludes ["node_group_index" ] = True
118118 if all (s .node_group_name == DEFAULT_REPLICA_GROUP_NAME for s in job_specs ):
@@ -122,8 +122,8 @@ def get_job_spec_excludes(job_specs: list[JobSpec]) -> IncludeExcludeDictType:
122122 return spec_excludes
123123
124124
125- def get_job_submission_excludes (job_submissions : list [JobSubmission ]) -> IncludeExcludeDictType :
126- submission_excludes : IncludeExcludeDictType = {}
125+ def get_job_submission_excludes (job_submissions : list [JobSubmission ]) -> IncludeExcludeStrDictType :
126+ submission_excludes : IncludeExcludeStrDictType = {}
127127 # `Resources.description` is deprecated and never set since 0.21. Not sending it lets 0.22
128128 # drop the field without breaking 0.21 clients.
129129 submission_excludes ["job_provisioning_data" ] = {
0 commit comments