Skip to content

refactor(core): remove mistyped property value workaround - #1289

Open
AlessandroPomponio wants to merge 1 commit into
mainfrom
ap_367_remove_handling_mistyped_property_values
Open

refactor(core): remove mistyped property value workaround#1289
AlessandroPomponio wants to merge 1 commit into
mainfrom
ap_367_remove_handling_mistyped_property_values

Conversation

@AlessandroPomponio

@AlessandroPomponio AlessandroPomponio commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Removes a temporary workaround that silently coerced mistyped PropertyValue instances — where a string or list value was stored with NUMERIC_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 the TEMP warning log paths and silent type-coercion logic that automatically upgraded NUMERIC_VALUE_TYPE values typed as str or list to STRING_VALUE_TYPE or VECTOR_VALUE_TYPE respectively. Validation now raises a ValueError with a descriptive message when the value type does not match the declared valueType.
  • tests/schema/test_property_value.py: Replaced the pytest.xfail markers (which documented the previously tolerated misbehaviour) with pytest.raises(pydantic.ValidationError) assertions, confirming the cases now correctly fail.

Impact

Any PropertyValue instances that were previously persisted or created with a NUMERIC_VALUE_TYPE label but holding a str or list value 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 right valueType. All other value-type combinations are unaffected.


AI Disclosure: The code and this PR description were generated using IBM Bob and were reviewed manually.

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
@AlessandroPomponio AlessandroPomponio added the ci Enables CI integration label Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Enables CI integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(schema): remove temporary handling of mistyped property values

1 participant