@@ -874,23 +874,6 @@ def exp_to_df(
874
874
metric_names = [m .name for m in metrics ]
875
875
results = results [results ["metric_name" ].isin (metric_names )]
876
876
877
- # Calculate relative metrics if `show_relative_metrics` is True.
878
- if show_relative_metrics :
879
- if exp .status_quo is None :
880
- logger .warning (
881
- "No status quo arm found. Showing raw metric values instead of "
882
- "relative metric values."
883
- )
884
- else :
885
- status_quo_arm_name = exp .status_quo .name
886
- try :
887
- results = _get_relative_results (results , status_quo_arm_name )
888
- except Exception :
889
- logger .warning (
890
- "Failed to calculate relative metrics. Showing raw metric values "
891
- "instead of relative metric values."
892
- )
893
-
894
877
# Add `FEASIBLE_COL_NAME` column according to constraints if any.
895
878
if (
896
879
exp .optimization_config is not None
@@ -910,6 +893,23 @@ def exp_to_df(
910
893
except (KeyError , ValueError , DataRequiredError ) as e :
911
894
logger .warning (f"Feasibility calculation failed with error: { e } " )
912
895
896
+ # Calculate relative metrics if `show_relative_metrics` is True.
897
+ if show_relative_metrics :
898
+ if exp .status_quo is None :
899
+ logger .warning (
900
+ "No status quo arm found. Showing raw metric values instead of "
901
+ "relative metric values."
902
+ )
903
+ else :
904
+ status_quo_arm_name = exp .status_quo .name
905
+ try :
906
+ results = _get_relative_results (results , status_quo_arm_name )
907
+ except Exception :
908
+ logger .warning (
909
+ "Failed to calculate relative metrics. Showing raw metric values "
910
+ "instead of relative metric values."
911
+ )
912
+
913
913
# If arms_df is empty, return empty results (legacy behavior)
914
914
if len (arms_df .index ) == 0 :
915
915
if len (results .index ) != 0 :
0 commit comments