diff --git a/aerospike_helpers/expressions/base.py b/aerospike_helpers/expressions/base.py index e7a4dddd87..b78711cd58 100644 --- a/aerospike_helpers/expressions/base.py +++ b/aerospike_helpers/expressions/base.py @@ -33,6 +33,7 @@ from aerospike_helpers.expressions.resources import ResultType from aerospike_helpers.expressions.resources import _Keys from aerospike_helpers.cdt_ctx import _cdt_ctx +import warnings TypeComparisonArg = Union[_BaseExpr, Any] TypeGeo = Union[_BaseExpr, aerospike.GeoJSON] @@ -1139,6 +1140,11 @@ class ResultRemove(_BaseExpr): _op = aerospike._AS_EXP_CODE_RESULT_REMOVE def __init__(self): + warnings.warn( + "This expression will be renamed to RemoveResult in the next major client release", + DeprecationWarning + ) + """ :return: (result_remove) """ diff --git a/test/new_tests/test_path_expressions.py b/test/new_tests/test_path_expressions.py index 9220f4dfcd..aa54a32511 100644 --- a/test/new_tests/test_path_expressions.py +++ b/test/new_tests/test_path_expressions.py @@ -560,17 +560,18 @@ def test_loopvar_id_list_index(self): assert bins == {self.LIST_BIN_NAME: [self.RECORD_BINS[self.LIST_BIN_NAME][0]]} def test_expr_result_remove(self): - ops = [ - operations.modify_by_path( - bin_name=self.MAP_OF_NESTED_MAPS_BIN_NAME, - ctx=[ - cdt_ctx.cdt_ctx_all_children(), - cdt_ctx.cdt_ctx_all_children() - ], - expr=ResultRemove().compile(), - flags=aerospike.EXP_PATH_MODIFY_DEFAULT - ) - ] + with pytest.warns(DeprecationWarning): + ops = [ + operations.modify_by_path( + bin_name=self.MAP_OF_NESTED_MAPS_BIN_NAME, + ctx=[ + cdt_ctx.cdt_ctx_all_children(), + cdt_ctx.cdt_ctx_all_children() + ], + expr=ResultRemove().compile(), + flags=aerospike.EXP_PATH_MODIFY_DEFAULT + ) + ] with self.expected_context_for_pos_tests: self.as_connection.operate(self.key, ops)