Skip to content

Example policy package is not linted by mypy and pylint #6328

@aylei

Description

@aylei

There is an type error caused by previous refactor of our SDK, but the code in example policy is not linted thus left unchanged:

$ sky launch task.yaml
...
YAML to run: task.yaml
D 07-21 10:47:16 common.py:308] Health check status: 200
I 07-21 10:47:16 admin_policy_utils.py:130] Applying client admin policy: EnforceAutostopPolicy
...
  File "/Users/romilb/Romil/Berkeley/Research/sky-experiments/sky/server/common.py", line 656, in wrapper
    return func(*args, **kwargs)
  File "/Users/romilb/Romil/Berkeley/Research/sky-experiments/sky/utils/annotations.py", line 22, in wrapper
    return func(*args, **kwargs)
  File "/Users/romilb/Romil/Berkeley/Research/sky-experiments/sky/utils/context.py", line 276, in wrapper
    return func(*args, **kwargs)
  File "/Users/romilb/Romil/Berkeley/Research/sky-experiments/sky/client/sdk.py", line 508, in launch
    with admin_policy_utils.apply_and_use_config_in_current_request(
  File "/Users/romilb/tools/anaconda3/envs/py310/lib/python3.10/contextlib.py", line 135, in __enter__
    return next(self.gen)
  File "/Users/romilb/Romil/Berkeley/Research/sky-experiments/sky/utils/admin_policy_utils.py", line 89, in apply_and_use_config_in_current_request
    dag, mutated_config = apply(entrypoint, request_options, at_client_side)
  File "/Users/romilb/Romil/Berkeley/Research/sky-experiments/sky/utils/admin_policy_utils.py", line 149, in apply
    raise exceptions.UserRequestRejectedByPolicy(
sky.exceptions.UserRequestRejectedByPolicy: User request rejected by policy <example_policy.skypilot_policy.EnforceAutostopPolicy object at 0x11ff37340>: [pydantic_core._pydantic_core.ValidationError] 2 validation errors for StatusBody
cluster_names
  Input should be a valid list [type=list_type, input_value='sky-bd30-romilb', input_type=str]
    For further information visit https://errors.pydantic.dev/2.11/v/list_type
refresh
  Input should be 'NONE', 'AUTO' or 'FORCE' [type=enum, input_value=True, input_type=bool]
    For further information visit https://errors.pydantic.dev/2.11/v/enum

Metadata

Metadata

Assignees

Labels

coreFeatures/bugs related to core

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions