Releases: daireto/odata-v4-query
v0.4.1
0.4.1 (2025-11-15)
This release introduces major enhancements including nested field filtering support, new string functions, improved query options handling, and comprehensive test coverage improvements.
Added
-
Nested field filtering support for all backends (SQLAlchemy, Beanie, PyMongo):
- Single-level nesting:
user/name - Multi-level nesting:
user/profile/address/city - Support for nested fields with all operators and functions
- Single-level nesting:
-
New string functions:
substring- Extract substring from a stringtolower- Convert string to lowercasetoupper- Convert string to uppercase
-
Enhanced query options:
clone()method forODataQueryOptionssupporting deep and shallow copyingremove_pagination_options()utility function$countoption support in SQLAlchemy and Beanie utilities
-
New error classes for better error handling:
AggregationOperatorNotSupportedErrorUnexpectedNumberOfArgumentsError
Breaking Changes
TwoArgumentsExpectedErrorhas been replaced byUnexpectedNumberOfArgumentsError.
Enhancements
-
Improved number handling in tokenizer to support negative numbers
-
Enhanced filter node parsers with comprehensive function parsing capabilities:
BaseFilterNodeParserwith extensible function parsing architectureSQLAlchemyFilterNodeParserwith nested relationship traversal usinghas()MongoDBFilterNodeParserwith proper field path normalization
-
Better documentation:
- Comprehensive docstrings for all utility functions
- Detailed parameter and return type descriptions
- Examples for nested field filtering in README
- Clarified unsupported functions and options for each backend
Fixed
- Removed
add_notefunction call to fix compatibility with Python <3.11 versions - Fixed async cursor handling in Beanie by monkey patching
AggregationQuery
Refactored
- Organized imports and updated
__all__exports in utility modules - Improved code formatting and consistency across test files
Testing
-
Significantly improved test coverage (100% coverage achieved):
- Added 30+ new tests for nested field filtering
- Added tests for new string functions (
substring,tolower,toupper) - Added tests for
clone()method and pagination removal - Added tests for
$countoption handling - Enhanced edge case and error handling tests
-
Coverage configuration:
- Excluded test files from coverage reports
- Added pragma comments for defensive code paths
Documentation
- Updated README with comprehensive examples for:
- Nested field filtering (single and multi-level)
- New string functions
- Unsupported features per backend
- Enhanced inline documentation with detailed examples and parameter descriptions
Performance
- Improved filter parsing efficiency with optimized field path resolution
- Better memory management by removing unnecessary caching
Summary of Changes
- 22 files changed: 1,631 insertions(+), 221 deletions(-)
- Test coverage: Achieved 100% coverage (950 statements)
- Total tests: 175 tests (up from 170)
- New features: Nested field filtering, 3 new string functions, query cloning
- Compatibility: Fixed Python 3.10 compatibility issues
This release significantly enhances the library's filtering capabilities and brings it closer to full OData V4 specification compliance, particularly with comprehensive nested field filtering support across all backends.
v0.3.0
0.3.0 (2025-06-07)
This release introduces refinements, performance improvements, and stricter enforcement of predefined operators and functions.
Enhancements
- Improved linting and formatting configurations with the addition of Ruff linter.
- Refined
parse_in_nin_operatorsmethod toparse_membership_operatorsfor better clarity.
Security
- Added a security policy document (
SECURITY.md) specifying guidelines for reporting vulnerabilities.
Fixed
- Addressed an import error.
- Fixed memory leak issues by removing unnecessary use of
lru_cache. - Corrected linting issues and improved code consistency.
- Ensured exceptions are raised when order direction values are not
"asc"or"desc".
Refactored
- Enforced predefined operators and functions by removing constructor-based initialization.
- Replaced generic
ParseErrorandEvaluateErrorwith specific exception classes. - Streamlined handling of operators and functions by introducing centralized arity management.
Documentation
- Updated contributing guidelines, especially commit message conventions.
- Removed the unnecessary "Raises" section from documentation.
Other
- Excluded the
testsfolder from linting but kept it for formatting.
Breaking Changes
-
Removed error classes:
EvaluateErrorParseError
-
Renamed error classes:
NoPositiveIntegerValue→NoPositiveErrorNoRootClassFound→NoRootClassErrorUnexpectedNullOperand→UnexpectedNullOperatorErrorUnsupportedFormat→UnsupportedFormatError
-
Added error classes:
InvalidOrderDirectionErrorOpeningParenthesisExpectedErrorCommaOrClosingParenthesisExpectedErrorMissingClosingParenthesisErrorNoNumericValueErrorTwoArgumentsExpectedErrorUnexpectedEmptyArgumentsErrorUnexpectedEndOfExpressionErrorUnexpectedNullFiltersErrorUnexpectedNullFunctionNameErrorUnexpectedNullIdentifierErrorUnexpectedNullListErrorUnexpectedNullLiteralErrorUnexpectedNullNodeTypeErrorUnexpectedNullOperandErrorUnexpectedTokenErrorUnknownFunctionErrorUnknownNodeTypeErrorUnknownOperatorError
v0.2.0
v0.1.0
0.1.0 (2025-03-19)
First release.
Features
-
Support for the following OData V4 standard query parameters:
$count- Include count of items$expand- Expand related entities$filter- Filter results$format- Response format (json, xml, csv, tsv)$orderby- Sort results$search- Search items$select- Select specific fields$skip- Skip N items$top- Limit to N items
-
Comprehensive filter expression support:
- Comparison operators:
eq,ne,gt,ge,lt,le,in,nin - Logical operators:
and,or,not,nor - Collection operators:
has - String functions:
startswith,endswith,contains
- Comparison operators:
-
Utility functions to apply options to ORM/ODM queries.