Adjust type of ChemicalFormulaFeaturizer.powers.#964
Conversation
The backend is opening up the type of powers to be floats. As such, this commit will deserialize powers as a list of floats. However, to preserve backwards compatability, the type of powers will be preserved, and a new field (powers_float) with the list as floats is introduced. In v4.0.0, the type of 'powers' will be changed, and 'powers_float' will be deprecated before its removal in v5.0.0.
94d1622 to
a812f20
Compare
kroenlein
left a comment
There was a problem hiding this comment.
I think the migration strategy proposed is overkill given the actual impacts in Python of changing an int to a float. But I will disagree and commit.
Returning incorrect values when the object contains non-integer powers feels like mishandling data. That definitely violates minimum-surprise for me.
The approach suggested has been rejected in conversations via Slack.
kroenlein
left a comment
There was a problem hiding this comment.
A proposed workflow that alerts users when we cast their values without adding additional exceptions.
StevenKauwe
left a comment
There was a problem hiding this comment.
Catching up from OOO. These changes look good to me! 👍
They seem to preserve current client behavior while also adding the ability to work with floats if the user opts into it. Beyond that, looks like a lot already got discussed. This was helpful for catching up!
kroenlein
left a comment
There was a problem hiding this comment.
Given the small number of people who I think will be affected by this and the addition of a mutation warning, I'll approve.
The backend is opening up the type of powers to be floats. As such, this commit will deserialize powers as a list of floats. However, to preserve backwards compatability, the type of powers will be preserved, and a new field (powers_float) with the list as floats is introduced. In v4.0.0, the type of 'powers' will be changed, and 'powers_float' will be deprecated before its removal in v5.0.0.
PR Type:
Adherence to team decisions