Skip to content

Releases: daireto/odata-v4-query

v0.4.1

16 Nov 04:38

Choose a tag to compare

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
  • New string functions:

    • substring - Extract substring from a string
    • tolower - Convert string to lowercase
    • toupper - Convert string to uppercase
  • Enhanced query options:

    • clone() method for ODataQueryOptions supporting deep and shallow copying
    • remove_pagination_options() utility function
    • $count option support in SQLAlchemy and Beanie utilities
  • New error classes for better error handling:

    • AggregationOperatorNotSupportedError
    • UnexpectedNumberOfArgumentsError

Breaking Changes

  • TwoArgumentsExpectedError has been replaced by UnexpectedNumberOfArgumentsError.

Enhancements

  • Improved number handling in tokenizer to support negative numbers

  • Enhanced filter node parsers with comprehensive function parsing capabilities:

    • BaseFilterNodeParser with extensible function parsing architecture
    • SQLAlchemyFilterNodeParser with nested relationship traversal using has()
    • MongoDBFilterNodeParser with 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_note function 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 $count option 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

08 Jun 01:14

Choose a tag to compare

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_operators method to parse_membership_operators for 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 ParseError and EvaluateError with 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 tests folder from linting but kept it for formatting.

Breaking Changes

  • Removed error classes:

    • EvaluateError
    • ParseError
  • Renamed error classes:

    • NoPositiveIntegerValueNoPositiveError
    • NoRootClassFoundNoRootClassError
    • UnexpectedNullOperandUnexpectedNullOperatorError
    • UnsupportedFormatUnsupportedFormatError
  • Added error classes:

    • InvalidOrderDirectionError
    • OpeningParenthesisExpectedError
    • CommaOrClosingParenthesisExpectedError
    • MissingClosingParenthesisError
    • NoNumericValueError
    • TwoArgumentsExpectedError
    • UnexpectedEmptyArgumentsError
    • UnexpectedEndOfExpressionError
    • UnexpectedNullFiltersError
    • UnexpectedNullFunctionNameError
    • UnexpectedNullIdentifierError
    • UnexpectedNullListError
    • UnexpectedNullLiteralError
    • UnexpectedNullNodeTypeError
    • UnexpectedNullOperandError
    • UnexpectedTokenError
    • UnknownFunctionError
    • UnknownNodeTypeError
    • UnknownOperatorError

v0.2.0

19 Mar 21:46

Choose a tag to compare

0.2.0 (2025-03-19)

Introduces the $page option and improves README.md.

Added

  • Support for $page option.

Documentation

  • Added examples for $search and $select options in ORM/ODM integration helpers.

v0.1.0

19 Mar 14:50

Choose a tag to compare

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
  • Utility functions to apply options to ORM/ODM queries.