Skip to content

Commit

Permalink
Merge pull request #535 from ddps-lab/azure-collector-fix
Browse files Browse the repository at this point in the history
df.drop 이 None 지원하지 않는 이슈 수정, SPS_Update_Time 결측 시 PriceEviction_Upda…
  • Loading branch information
krtaiyang authored Feb 26, 2025
2 parents 5e313b7 + eee0538 commit fd92b20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,13 @@ def process_zone_data(price_saving_if_df, sps_res_df, time_datetime, is_true_zon

if is_true_zone:
prev_availability_zone_true_all_data_df = S3.read_file(f"{AZURE_CONST.S3_LATEST_ALL_DATA_AVAILABILITY_ZONE_TRUE_PKL_GZIP_SAVE_PATH}", 'pkl.gz')
prev_availability_zone_true_all_data_df.drop(columns=['id'], inplace=True)

workload_cols = ['InstanceTier', 'InstanceType', 'Region', 'AvailabilityZone', 'DesiredCount']
feature_cols = ['OndemandPrice', 'SpotPrice', 'IF', 'Score', 'SPS_Update_Time']

changed_df = None
if prev_availability_zone_true_all_data_df is not None and not prev_availability_zone_true_all_data_df.empty:
prev_availability_zone_true_all_data_df.drop(columns=['id'], inplace=True)
changed_df = compare_sps(prev_availability_zone_true_all_data_df, all_data_zone_true_df, workload_cols, feature_cols)

update_success = update_latest(all_data_zone_true_df, is_true_zone)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def merge_if_saving_price_sps_df(price_saving_if_df, sps_df, availability_zones=
join_df.rename(columns={'time_x': 'PriceEviction_Update_Time', 'time_y': 'SPS_Update_Time'}, inplace=True)
join_df.drop(columns=['id', 'InstanceTypeSPS', 'RegionCodeSPS'], inplace=True)

join_df['SPS_Update_Time'].fillna(join_df['PriceEviction_Update_Time'], inplace=True)

columns = ["InstanceTier", "InstanceType", "Region", "OndemandPrice", "SpotPrice", "Savings", "IF",
"DesiredCount", "Score", "SPS_Update_Time"]

Expand Down

0 comments on commit fd92b20

Please sign in to comment.