Skip to content

Conversation

@abrookins
Copy link
Collaborator

Summary

This PR fixes three bugs identified for the 1.0 release:

Bug Fixes

#108 - Enum with int values produces wrong query syntax

  • When using a regular Enum (not IntEnum) with int values in queries, the query would produce incorrect syntax like @status:[Status.ACTIVE Status.ACTIVE] instead of @status:[2 2]
  • Fix: Extract .value from Enum objects in resolve_value() for NUMERIC fields

#499 - IN operator doesn't work for NUMERIC fields

  • The IN operator (<<) only worked for TAG fields, not NUMERIC fields
  • Fix: Generate OR of range queries for IN/NOT_IN on NUMERIC fields: (@field:[v1 v1])|(@field:[v2 v2])

#254 - Optional field retrieval breaks HashModel

  • HashModel stores None as empty string "" because Redis HSET requires non-null values
  • On retrieval, the empty string couldn't be parsed as the expected type (e.g., float), causing ValidationError
  • Fix: Added convert_empty_strings_to_none() that converts empty strings back to None for Optional fields

Changes

  • aredis_om/model/model.py: Core fixes for all three bugs
  • tests/test_bug_fixes.py: New test file with 6 tests covering all fixes

Testing

All 480 tests pass.

Closes #108
Closes #254
Closes #499

- Add redisvl as optional dependency (pip install redis-om[redisvl])
- Add to_redisvl_schema() to convert OM models to RedisVL IndexSchema
- Add get_redisvl_index() to get ready-to-use SearchIndex
- Supports all OM field types: text, tag, numeric, vector
- Supports FLAT and HNSW vector algorithms with all parameters

Refs #790
- #108: Extract .value from Enum objects in NUMERIC queries
- #499: Add IN/NOT_IN operator handling for NUMERIC fields
- #254: Convert empty strings back to None for Optional fields in HashModel.get()
@abrookins abrookins force-pushed the feature/redisvl-integration branch from 6428db8 to 6bb86bc Compare January 24, 2026 15:59
@abrookins abrookins merged commit 58a0ff8 into main Jan 26, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants