Skip to content

Fix ValueError in FillMissingParameters with empty experiment data#4973

Open
richagadgil wants to merge 1 commit intofacebook:mainfrom
richagadgil:export-D95266027
Open

Fix ValueError in FillMissingParameters with empty experiment data#4973
richagadgil wants to merge 1 commit intofacebook:mainfrom
richagadgil:export-D95266027

Conversation

@richagadgil
Copy link

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

Differential Revision: D95266027

@meta-cla meta-cla bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Mar 4, 2026
@meta-codesync
Copy link

meta-codesync bot commented Mar 4, 2026

@richagadgil has exported this pull request. If you are a Meta employee, you can view the originating Diff in D95266027.

@codecov-commenter
Copy link

codecov-commenter commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.83%. Comparing base (f973cb4) to head (c4a3f6e).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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
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
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants