Commit d14abed
Fix ValueError in FillMissingParameters with empty experiment data (#4973)
Summary:
Pull Request resolved: #4973
`FillMissingParameters.transform_experiment_data` crashes with
`ValueError: Columns must be same length as key` when `arm_data` has
zero rows (e.g., during initial Sobol trial generation before any
trials have completed).
This happens because `DataFrame.apply(func, axis=1)` on an empty
DataFrame returns an empty DataFrame rather than an empty Series.
Assigning that DataFrame to a single column then fails.
Replace `arm_data.apply(...)` with a list comprehension over
`arm_data.iterrows()`, which correctly produces an empty list for
empty DataFrames.
Failing run: https://www.internalfb.com/mlhub/flow/1044918711/overview
Reviewed By: yuhuishi-convect, saitcakmak
Differential Revision: D952660271 parent f973cb4 commit d14abed
1 file changed
Lines changed: 1 addition & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
| 104 | + | |
108 | 105 | | |
109 | 106 | | |
110 | 107 | | |
| |||
0 commit comments