neosqlite.collection.query_engine.python_aggregation_engine module

Python fallback aggregation engine for NeoSQLite.

This module implements the Tier-3 (Python-based) aggregation pipeline execution. It is used only when the SQL-based tiers (Tier 1 and Tier 2) cannot optimize a pipeline.

The logic was extracted from QueryEngine.aggregate_with_constraints() to keep that class at a manageable size.

neosqlite.collection.query_engine.python_aggregation_engine.execute_python_aggregation(query_engine: QueryEngine, pipeline: list[dict[str, Any]], session: Any = None) list[dict[str, Any]][source]

Execute pipeline entirely in Python (Tier-3 fallback).

Args: query_engine: The QueryEngine instance that owns this pipeline. pipeline: List of aggregation stage dicts. session: Optional client session (currently unused by Tier 3).

Returns: List of result documents after applying all pipeline stages.