Skip to content

Commit

Permalink
change the match statement to if else due to mypy limit
Browse files Browse the repository at this point in the history
  • Loading branch information
zpoint committed Nov 4, 2024
1 parent 043dd28 commit bc767c8
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions sky/utils/controller_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,19 +677,18 @@ def replace_skypilot_config_path_in_file_mounts(

def _get_workdir_bucket_name_from_config(store_type: storage_lib.StoreType) -> None:
nested_key = ('aws', 'workdir_bucket_name')
match store_type:
case storage_lib.StoreType.S3:
nested_key = (str(clouds.AWS()).lower(), 'workdir_bucket_name')
case storage_lib.StoreType.GCS:
nested_key = (str(clouds.GCP()).lower(), 'workdir_bucket_name')
case storage_lib.StoreType.AZURE:
nested_key = (str(clouds.Azure()).lower(), 'workdir_bucket_name')
case storage_lib.StoreType.R2:
nested_key = (cloudflare.NAME.lower(), 'workdir_bucket_name')
case storage_lib.StoreType.IBM:
nested_key = (str(clouds.IBM()).lower(), 'workdir_bucket_name')
case _:
raise ValueError(f"Unsupported store type: {store_type}")
if store_type == storage_lib.StoreType.S3:
nested_key = (str(clouds.AWS()).lower(), 'workdir_bucket_name')
elif store_type == storage_lib.StoreType.GCS:
nested_key = (str(clouds.GCP()).lower(), 'workdir_bucket_name')
elif store_type == storage_lib.StoreType.AZURE:
nested_key = (str(clouds.Azure()).lower(), 'workdir_bucket_name')
elif store_type == storage_lib.StoreType.R2:
nested_key = (cloudflare.NAME.lower(), 'workdir_bucket_name')
elif store_type == storage_lib.StoreType.IBM:
nested_key = (str(clouds.IBM()).lower(), 'workdir_bucket_name')
else:
raise ValueError(f"Unsupported store type: {store_type}")
return skypilot_config.get_nested(nested_key, None)


Expand Down

0 comments on commit bc767c8

Please sign in to comment.