diff --git a/aerospike_helpers/expressions/resources.py b/aerospike_helpers/expressions/resources.py index 048ae4aca0..a041d359b5 100644 --- a/aerospike_helpers/expressions/resources.py +++ b/aerospike_helpers/expressions/resources.py @@ -1,6 +1,7 @@ """ Resources used by all expressions. """ +from __future__ import annotations # from __future__ import annotations from itertools import chain @@ -266,7 +267,12 @@ def __mod__(self, right: "TypeAny"): def _create_operator_expression(left_children: "TypeChildren", right_children: "TypeChildren", op_type: int): new_expr = _BaseExpr() new_expr._op = op_type - new_expr._children = (*left_children, *right_children) + # Ensure both are tuples (handles generators and lists) before concatenation + if not isinstance(left_children, tuple): + left_children = tuple(left_children) + if not isinstance(right_children, tuple): + right_children = tuple(right_children) + new_expr._children = left_children + right_children return new_expr