We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ee73e7d commit db5e45dCopy full SHA for db5e45d
sky/clouds/service_catalog/common.py
@@ -330,7 +330,10 @@ def get_region_zones(df: pd.DataFrame,
330
use_spot: bool) -> List[cloud_lib.Region]:
331
"""Returns a list of regions/zones from a dataframe."""
332
price_str = 'SpotPrice' if use_spot else 'Price'
333
- df = df.dropna(subset=[price_str]).sort_values(price_str)
+ sort_keys = [price_str, 'Region']
334
+ if 'AvailabilityZone' in df.columns:
335
+ sort_keys.append('AvailabilityZone')
336
+ df = df.dropna(subset=[price_str]).sort_values(sort_keys)
337
regions = [cloud_lib.Region(region) for region in df['Region'].unique()]
338
if 'AvailabilityZone' in df.columns:
339
zones_in_region = df.groupby('Region')['AvailabilityZone'].apply(
0 commit comments