Fix ValueError in FillMissingParameters with empty experiment data#4973
Open
richagadgil wants to merge 1 commit intofacebook:mainfrom
Open
Fix ValueError in FillMissingParameters with empty experiment data#4973richagadgil wants to merge 1 commit intofacebook:mainfrom
richagadgil wants to merge 1 commit intofacebook:mainfrom
Conversation
|
@richagadgil has exported this pull request. If you are a Meta employee, you can view the originating Diff in D95266027. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4973 +/- ##
=======================================
Coverage 96.83% 96.83%
=======================================
Files 599 599
Lines 64518 64528 +10
=======================================
+ Hits 62473 62483 +10
Misses 2045 2045 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
6d78f18 to
88327fc
Compare
richagadgil
pushed a commit
to richagadgil/Ax
that referenced
this pull request
Mar 5, 2026
…acebook#4973) Summary: `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: D95266027
richagadgil
pushed a commit
to richagadgil/Ax
that referenced
this pull request
Mar 5, 2026
…acebook#4973) Summary: Pull Request resolved: facebook#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: D95266027
88327fc to
4201ac0
Compare
richagadgil
pushed a commit
to richagadgil/Ax
that referenced
this pull request
Mar 5, 2026
…acebook#4973) Summary: Pull Request resolved: facebook#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: D95266027
4201ac0 to
d14abed
Compare
…acebook#4973) Summary: `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: D95266027
d14abed to
c4a3f6e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
FillMissingParameters.transform_experiment_datacrashes withValueError: Columns must be same length as keywhenarm_datahaszero rows (e.g., during initial Sobol trial generation before any
trials have completed).
This happens because
DataFrame.apply(func, axis=1)on an emptyDataFrame 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 overarm_data.iterrows(), which correctly produces an empty list forempty DataFrames.
Failing run: https://www.internalfb.com/mlhub/flow/1044918711/overview
Differential Revision: D95266027