Commit 3e8e4e7
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
passing run:
https://www.internalfb.com/mlhub/flow/1045916604/overview
Reviewed By: yuhuishi-convect, saitcakmak
Differential Revision: D95266027
fbshipit-source-id: 41cffa6fe9aa169a4fae727a135e2856197bfd641 parent 9a79809 commit 3e8e4e7
File tree
2 files changed
+50
-11
lines changed- ax/adapter/transforms
- tests
2 files changed
+50
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | 98 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
| 99 | + | |
108 | 100 | | |
109 | 101 | | |
110 | 102 | | |
| |||
Lines changed: 49 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | | - | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
0 commit comments