Commit 3bcf8c4
Remove deprecated ObjectiveThreshold assert_is_instance checks (#5105)
Summary:
Pull Request resolved: #5105
After the recent refactoring in D93520819 that deprecated `ObjectiveThreshold` in favor of plain `OutcomeConstraint`, two locations in the codebase still used `assert_is_instance(..., ObjectiveThreshold)` which would fail when objective thresholds are represented as plain `OutcomeConstraint` objects (the new recommended pattern).
This caused Axolotl to crash with:
```
TypeError: obj is not an instance of cls: obj=OutcomeConstraint(core_app:ecosystem:linked_sessions:fb_session_count_cap30 >= 58.924384179812996) cls=<class 'ax.core.outcome_constraint.ObjectiveThreshold'>
```
Changes:
- `ax/storage/sqa_store/encoder.py`: Updated `objective_threshold_to_sqa` to accept `OutcomeConstraint` instead of `ObjectiveThreshold`, and removed the `assert_is_instance` cast at the call site. Since `ObjectiveThreshold` is deprecated and `MultiObjectiveOptimizationConfig.objective_thresholds` is typed as `list[OutcomeConstraint]`, these assertions were incorrect.
Reviewed By: mpolson64
Differential Revision: D98172405
fbshipit-source-id: 98ad65db14e473ac45c721e7a9ad0963724d7fdf1 parent 316dbad commit 3bcf8c4
1 file changed
Lines changed: 3 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 42 | + | |
47 | 43 | | |
48 | 44 | | |
49 | 45 | | |
| |||
772 | 768 | | |
773 | 769 | | |
774 | 770 | | |
775 | | - | |
| 771 | + | |
776 | 772 | | |
777 | 773 | | |
778 | 774 | | |
| |||
847 | 843 | | |
848 | 844 | | |
849 | 845 | | |
850 | | - | |
851 | | - | |
852 | | - | |
| 846 | + | |
853 | 847 | | |
854 | 848 | | |
855 | 849 | | |
| |||
0 commit comments