feat: add optimization field to optimization for backwards compatibil…#310
Open
jeremiespiesser-extrality wants to merge 1 commit into
Open
feat: add optimization field to optimization for backwards compatibil…#310jeremiespiesser-extrality wants to merge 1 commit into
jeremiespiesser-extrality wants to merge 1 commit into
Conversation
1b60c33 to
d8f6ebf
Compare
…ity. Adds a `.optimization` field to class Optimization for backwards compatibility. Removes the need to do an `if` clause in ``` optimization.id if isinstance(optimization, Optimization) else optimization.optimization.id ```
d8f6ebf to
35c20fa
Compare
msd-11
approved these changes
May 26, 2026
msd-11
left a comment
Contributor
There was a problem hiding this comment.
Is LegacyOptimization something that is going to disappear in the future ?
Contributor
Author
|
Yes It will once we switch to only server side optims |
tmpbeing
reviewed
Jun 1, 2026
| optimization_id = ( | ||
| optimization.id if isinstance(optimization, Optimization) else optimization.optimization.id | ||
| ) | ||
| optimization_id = optimization.optimization.id |
Collaborator
There was a problem hiding this comment.
Was the previous method broken ? I don't think we should recommend users to use that approach when we probably don't want to keep it long term.
|
|
||
| @property | ||
| def optimization(self) -> Self: | ||
| """Returns self. Present for backwards compatibility with LegacyOptimizationResult.""" |
Collaborator
There was a problem hiding this comment.
I'd add a deprecation warning saying this will be removed when the legacy client-side optimization will be removed.
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.
[sc-38951]
Adds a
.optimizationfield to class Optimization for backwards compatibility.Removes the need to do the
ifclause in