refactor(core): remove mistyped property value workaround - #1289
Open
AlessandroPomponio wants to merge 1 commit into
Open
refactor(core): remove mistyped property value workaround#1289AlessandroPomponio wants to merge 1 commit into
AlessandroPomponio wants to merge 1 commit into
Conversation
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
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
Removes a temporary workaround that silently coerced mistyped
PropertyValueinstances — where astringorlistvalue was stored withNUMERIC_VALUE_TYPE— into the correct type. Instead, passing a mismatched value now raises a hard validation error, enforcing strict type correctness.Closes #367
High-level Changes
ado/schema/property_value.py: Removed theTEMPwarning log paths and silent type-coercion logic that automatically upgradedNUMERIC_VALUE_TYPEvalues typed asstrorlisttoSTRING_VALUE_TYPEorVECTOR_VALUE_TYPErespectively. Validation now raises aValueErrorwith a descriptive message when the value type does not match the declaredvalueType.tests/schema/test_property_value.py: Replaced thepytest.xfailmarkers (which documented the previously tolerated misbehaviour) withpytest.raises(pydantic.ValidationError)assertions, confirming the cases now correctly fail.Impact
Any
PropertyValueinstances that were previously persisted or created with aNUMERIC_VALUE_TYPElabel but holding astrorlistvalue can no longer be loaded or constructed. This is a breaking change for any data that relied on the old silent coercion; such records would need to be corrected at the source to carry the rightvalueType. All other value-type combinations are unaffected.