Repository navigation
docs: fix the coverage command in CONTRIBUTING.md - #806
Closed
vishal-bala wants to merge 1 commit into
Closed
vishal-bala wants to merge 1 commit into
vishal-bala wants to merge 1 commit into
Conversation
pytest-cov is not a dev dependency, so `uv run pytest --cov` fails with an unrecognised argument. Add it for the run with `uv run --with`.
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.
Motivation
The INT8/UINT8 range check in the vector validator never runs. It compared
str(datatype).upper()with"INT8"and"UINT8".datatypeis aVectorDataType(str, Enum)member, though, andstr()on a str-mixin Enum returns"VectorDataType.INT8", so neither branch ever matched. On every supported Python version, a JSON schema with anint8vector field therefore accepts{"v": [999, -999]}throughvalidate_object.Changes
redisvl/schema/validation.py: the vector validator now compares enum members directly (datatype == VectorDataType.INT8), as_map_field_to_pydantic_typein the same module already does. I flattened the nestedifthat the string comparison needed.tests/unit/test_validation.py:TestIntegerVectorRangeValidationcovers the boundary values on both sides for INT8 (-128, 127) and UINT8 (0, 255), plus the reported[999, -999]repro, on a JSON-storage schema. Hash storage takes bytes and is unaffected.I searched
redisvl/for otherstr(<enum member>)comparisons and found none.mcp/tools/upsert.py:_vector_dtypeunwraps.valuefirst.Release Notes
Schema validation now enforces the integer vector ranges it always claimed to.
validate_object,load(..., validate_on_load=True)and the MCP upsert tool reject JSONint8vectors with elements outside -128..127, anduint8vectors outside 0..255. These inputs used to pass validation silently.Reviewer Brief
Start here:
redisvl/schema/validation.py,_validate_vectorinsidemake_vector_validator. The whole fix is its two member comparisons.Not verified: Redis's documentation confirms that
INT8/UINT8vector types exist, but I found no page that states their element ranges. -128..127 and 0..255 are the standard 8-bit ranges, not ones checked against Redis docs. I did not run integration tests (validate_on_loadand the MCP upsert path) locally. CI runs them.Beyond CI: the five new rejection cases fail against the code before the fix, and pass with it.
Reviewed
0e525da2· Claude Code (claude-opus-5-5) · lenses: correctness, security, design, tests, docs, Redis behaviour