Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions aerospike_helpers/expressions/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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)
"""
Expand Down
23 changes: 12 additions & 11 deletions test/new_tests/test_path_expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading