Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
0fa3ed2
First pass at refactoring. Many memory leaks present
juliannguyen4 Jan 9, 2026
b9d6ecd
fix
juliannguyen4 Jan 9, 2026
5dab352
fix
juliannguyen4 Jan 9, 2026
8b524a3
fix
juliannguyen4 Jan 10, 2026
e666b80
list_sort doesn't take in a list_order arg
juliannguyen4 Jan 10, 2026
2e2b84f
fix index param related errors
juliannguyen4 Jan 10, 2026
d6d5d01
Add missing breaks
juliannguyen4 Jan 10, 2026
3250d01
Fix some operations not receiving the return type in python
juliannguyen4 Jan 10, 2026
c2c56f4
fix.
juliannguyen4 Jan 12, 2026
8b9fc85
fix
juliannguyen4 Jan 12, 2026
fd97333
Fix
juliannguyen4 Jan 12, 2026
2155493
Move switch cases in ascending order so there is a greater chance the…
juliannguyen4 Jan 12, 2026
3e6ebb1
fix...
juliannguyen4 Jan 12, 2026
43e959f
fix
juliannguyen4 Jan 12, 2026
80797cb
fix
juliannguyen4 Jan 12, 2026
d075896
Revert "fix"
juliannguyen4 Jan 12, 2026
ca3a433
fix
juliannguyen4 Jan 12, 2026
935373b
Fix
juliannguyen4 Jan 12, 2026
799f8eb
fix
juliannguyen4 Jan 12, 2026
efe8f4a
fix
juliannguyen4 Jan 12, 2026
c61d4a4
Create a variable to get the results of the ternary operation. This m…
juliannguyen4 Jan 12, 2026
114c568
list_append and list_insert take in a different key for the list of v…
juliannguyen4 Jan 12, 2026
77531b5
fix
juliannguyen4 Jan 12, 2026
7135611
Also refactor list_policy code to reduce number of times ternary oper…
juliannguyen4 Jan 12, 2026
23b4821
fix...
juliannguyen4 Jan 12, 2026
0cf272f
fix
juliannguyen4 Jan 12, 2026
86a21f5
Fix mem leaks
juliannguyen4 Jan 12, 2026
982816e
Fix
juliannguyen4 Jan 12, 2026
ed26bbd
as_val shouldn't be destroyed since C client already takes ownership …
juliannguyen4 Jan 12, 2026
a1ed9b7
fix
juliannguyen4 Jan 12, 2026
f372b80
Curly brackets only needed after case if local variable is initialized
juliannguyen4 Jan 12, 2026
a339e89
use X-macro to map operation codes to operation names
juliannguyen4 Jan 12, 2026
23f5b55
Define global variable in C source file instead of header to avoid du…
juliannguyen4 Jan 12, 2026
6f34f7c
Fix memory error
juliannguyen4 Jan 13, 2026
940a704
move heap allocations further down the function for performance
juliannguyen4 Jan 13, 2026
4207bf3
Fix bug where get_cdt_ctx calls a C client API even though the conver…
juliannguyen4 Jan 13, 2026
18e9a3e
get_cdt_ctx must set status local var or it will be AEROSPIKE_OK
juliannguyen4 Jan 13, 2026
4f41534
Clear up why we have this flag instead of using succeed flag
juliannguyen4 Jan 13, 2026
5e73947
Add test case for list_remove_by_index_range receiving count = None
juliannguyen4 Jan 13, 2026
22094f1
Revert "Add test case for list_remove_by_index_range receiving count …
juliannguyen4 Jan 13, 2026
f257041
Those stack vars belong to specific cases so they should be in their …
juliannguyen4 Jan 13, 2026
8478474
Merge remote-tracking branch 'origin/dev' into CLIENT-4055-refactor-c…
juliannguyen4 Jan 16, 2026
21c27ed
Merge remote-tracking branch 'origin/dev' into CLIENT-4055-refactor-c…
juliannguyen4 Jan 29, 2026
9e5f6d1
Merge remote-tracking branch 'origin/dev' into CLIENT-4055-refactor-c…
juliannguyen4 Feb 25, 2026
401800c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 25, 2026
beb0b1c
Merge remote-tracking branch 'origin/dev' into CLIENT-4055-refactor-c…
juliannguyen4 Apr 23, 2026
c44b6a6
List ops aren't new anymore
juliannguyen4 Apr 23, 2026
c1a8785
Simplify code by using only 2 as_val variables instead of four. This …
juliannguyen4 Apr 23, 2026
534f1ad
Fix compiler error
juliannguyen4 Apr 23, 2026
a6e13fd
test is negative.
juliannguyen4 Apr 23, 2026
a8fd0cc
add more positive test cases to address missing code coverage
juliannguyen4 Apr 23, 2026
5381dd5
Merge remote-tracking branch 'origin/dev' into CLIENT-4697-refactor-o…
juliannguyen4 May 8, 2026
fe09cb4
Rm unused struct from last refactor PR
juliannguyen4 May 8, 2026
dc9e001
WIP
juliannguyen4 May 8, 2026
2f57d86
more wip
juliannguyen4 May 8, 2026
fe230ad
Merge remote-tracking branch 'origin/dev' into CLIENT-4697-refactor-o…
juliannguyen4 Jul 1, 2026
0dc23e7
Merge remote-tracking branch 'origin/dev' into CLIENT-4697-refactor-o…
juliannguyen4 Jul 2, 2026
6197d96
Merge remote-tracking branch 'origin/dev' into CLIENT-4697-refactor-o…
juliannguyen4 Jul 7, 2026
b676159
Refactor ctx code to be consistent with the other ops
juliannguyen4 Jul 7, 2026
0a94dd3
Rename list_and_string_operate.c to operate_helper.c. Incorporate cdt…
juliannguyen4 Jul 7, 2026
57e488b
Address bad implementation that would likely fail..
juliannguyen4 Jul 7, 2026
5e46ff5
Address compiler errors
juliannguyen4 Jul 7, 2026
3ef114c
Address compiler error - get_map_return_type shouldnt be static
juliannguyen4 Jul 7, 2026
b559236
Address compiler error
juliannguyen4 Jul 7, 2026
5729c0c
Address test regressions
juliannguyen4 Jul 7, 2026
04dde75
Address test regressions
juliannguyen4 Jul 7, 2026
6338b8e
Address test regressions
juliannguyen4 Jul 7, 2026
6dfacac
Bump aerospike-client-c from `785fa24` to `bce75a6`
dependabot[bot] Jul 7, 2026
3fd4d7e
Merge branch 'dependabot/submodules/dev/aerospike-client-c-bce75a6' i…
juliannguyen4 Jul 7, 2026
256d93e
Add new abort status ABORT_COMMIT_FAILED and txn state TXN_STATE_COMM…
juliannguyen4 Jul 8, 2026
639146f
Merge branch 'dependabot/submodules/dev/aerospike-client-c-bce75a6' i…
juliannguyen4 Jul 8, 2026
7fd6cfd
Merge remote-tracking branch 'origin/dev' into CLIENT-4697-refactor-o…
juliannguyen4 Jul 8, 2026
48a4a54
Print deprecation warning if aerospike_helpers.operations receives an…
juliannguyen4 Jul 8, 2026
d656c5f
port documentation changes from other CLIENT-4697 branch now that all…
juliannguyen4 Jul 8, 2026
96b10d9
Merge branch 'CLIENT-4697-refactor-only-cdt_map_operate' into CLIENT-…
juliannguyen4 Jul 8, 2026
b929f9b
Merge remote-tracking branch 'origin/dev' into CLIENT-4678-warn-if-ae…
juliannguyen4 Jul 8, 2026
1db1980
Revert "Print deprecation warning if aerospike_helpers.operations rec…
juliannguyen4 Jul 8, 2026
301ee23
Detect if enum values passed to aerospike_helpers.operations are out …
juliannguyen4 Jul 9, 2026
07cf155
Address compiler error
juliannguyen4 Jul 9, 2026
dc69054
Address compiler warning about potential uninitialized read.
juliannguyen4 Jul 9, 2026
be21364
Move comment about get_bounded_int_from_py_dict to the header file
juliannguyen4 Jul 9, 2026
dc9631e
Revert aerospike_helpers.operations documentation changes to be added…
juliannguyen4 Jul 9, 2026
fee05c7
improve var naming in helper
juliannguyen4 Jul 9, 2026
66d04c9
Somehow updating c def didn't update c decl
juliannguyen4 Jul 9, 2026
ca7b193
Initialize var right away to prevent undef reads.
juliannguyen4 Jul 9, 2026
f6f13d6
Rename new helper to get_enum_from_py_dict and reduce number of param…
juliannguyen4 Jul 9, 2026
1be3467
Make var naming less confusing
juliannguyen4 Jul 9, 2026
10f6ded
Rm unnecessary cast
juliannguyen4 Jul 9, 2026
0fcd9e4
Allow ops with map_order attribute that are parsed in operate.c
juliannguyen4 Jul 9, 2026
835cdd6
Fix regression where map_order option in map policy is no longer opti…
juliannguyen4 Jul 9, 2026
1a49f84
Fix regression where bit_write_flags is no longer optional
juliannguyen4 Jul 9, 2026
46f35b1
Add tests to make sure warning is printed for invalid values passed t…
juliannguyen4 Jul 9, 2026
3f51c8d
Fix invalid import in test
juliannguyen4 Jul 9, 2026
961fc32
Fix invalid use of hll_add in test.
juliannguyen4 Jul 9, 2026
fbd1555
Address test fixture not running
juliannguyen4 Jul 9, 2026
fa07baf
Fix bug
juliannguyen4 Jul 9, 2026
148909f
If we ignore all ServerError exceptions but only expect DeprecationWa…
juliannguyen4 Jul 9, 2026
3a4c454
Address test syntax error.
juliannguyen4 Jul 10, 2026
bba8295
Only show deprecation warnings for flags if the value is > 2 * (max v…
juliannguyen4 Jul 10, 2026
a14fc6d
Merge remote-tracking branch 'origin/dev' into CLIENT-4678-warn-if-ae…
juliannguyen4 Jul 10, 2026
f79b395
Fix bug where if an optional policy field is not set, -1 is passed fo…
juliannguyen4 Jul 10, 2026
a8778bf
Show the actual invalid argument in the error message to make easier …
juliannguyen4 Jul 10, 2026
5f74e41
Change test case to check map_order instead of map_write_flags, since…
juliannguyen4 Jul 10, 2026
1d33c05
Clarify that min and max bounds are inclusive in error message.
juliannguyen4 Jul 10, 2026
8b05be6
TODO's have been addressed.
juliannguyen4 Jul 10, 2026
918f17d
Improve C label naming.
juliannguyen4 Jul 10, 2026
694f602
Make py_dict var name generic. get_int_from_py_dict is used by as_cdt…
juliannguyen4 Jul 10, 2026
2d789b5
Clear up behavior of get_enum_from_py_dict
juliannguyen4 Jul 10, 2026
284afe0
Further clear up how helper should work
juliannguyen4 Jul 10, 2026
c8c1c87
Clarify why there is a try-catch statement in the tests
juliannguyen4 Jul 10, 2026
a20e29e
Since map_order is verified for operations, also verify it in the res…
juliannguyen4 Jul 10, 2026
a0bab37
Verify list_order option throughout codebase
juliannguyen4 Jul 10, 2026
2971223
Verify bit resize flags everywhere in codebase.
juliannguyen4 Jul 10, 2026
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
12 changes: 11 additions & 1 deletion src/include/cdt_operation_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,18 @@ as_status get_optional_int64_t(as_error *err, const char *key,
as_status get_uint64_t(as_error *err, const char *key, PyObject *op_dict,
uint64_t *ui64_valptr);

// This is used to validate enum arguments
// In C99, enum values can be between INT_MIN and INT_MAX
// So we define our min and max bound parameters as integer types
// https://stackoverflow.com/a/366033
// If is_optional is true, int_pointer does not get dereferenced.
// min_bound and max_bound are inclusive
as_status get_enum_from_py_dict(as_error *err, const char *key,
PyObject *py_dict, int *int_pointer,
int min_bound, int max_bound, bool is_optional);

as_status get_int_from_py_dict(as_error *err, const char *key,
PyObject *op_dict, int *int_pointer);
PyObject *py_dict, int *int_pointer);

as_status get_list_return_type(as_error *err, PyObject *op_dict,
int *return_type);
Expand Down
12 changes: 5 additions & 7 deletions src/main/client/bit_operate.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,17 +343,15 @@ as_status add_new_bit_op(AerospikeClient *self, as_error *err,
static as_status get_bit_resize_flags(as_error *err, PyObject *op_dict,
as_bit_resize_flags *resize_flags)
{
int64_t flags64;
bool found = false;
int tmp_value;
*resize_flags = AS_BIT_RESIZE_DEFAULT;

if (get_optional_int64_t(err, RESIZE_FLAGS_KEY, op_dict, &flags64,
&found) != AEROSPIKE_OK) {
if (get_enum_from_py_dict(
err, RESIZE_FLAGS_KEY, op_dict, &tmp_value, AS_BIT_RESIZE_DEFAULT,
AS_BIT_RESIZE_SHRINK_ONLY * 2 - 1, true) != AEROSPIKE_OK) {
return err->code;
}
if (found) {
*resize_flags = (as_bit_resize_flags)flags64;
}
*resize_flags = (as_bit_resize_flags)tmp_value;

return AEROSPIKE_OK;
}
Expand Down
65 changes: 55 additions & 10 deletions src/main/client/cdt_operation_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,22 +196,67 @@ as_status get_uint64_t(as_error *err, const char *key, PyObject *op_dict,
return AEROSPIKE_OK;
}

as_status get_int_from_py_dict(as_error *err, const char *key,
PyObject *op_dict, int *int_pointer)
#define OUT_OF_BOUNDS_MESSAGE \
"%s must be inclusively between %d and %d, but received %" PRId64 \
" instead."

static inline as_status
get_bound_int_from_py_dict(as_error *err, const char *key, PyObject *py_dict,
int *int_pointer, int min_bound, int max_bound,
bool is_optional, bool warn_if_out_of_bounds)
{
int64_t int64_to_return = -1;
int64_t int64 = -1;
bool found = false;
if (get_optional_int64_t(err, key, py_dict, &int64, &found) !=
AEROSPIKE_OK) {
goto exit_without_returning_int;
}

if (get_int64_t(err, key, op_dict, &int64_to_return) != AEROSPIKE_OK) {
return err->code;
if (!found) {
if (!is_optional) {
return as_error_update(err, AEROSPIKE_ERR_PARAM,
"Operation missing required entry %s", key);
}
else {
goto exit_without_returning_int;
}
}

if (int64_to_return > INT_MAX || int64_to_return < INT_MIN) {
return as_error_update(err, AEROSPIKE_ERR_PARAM,
"%s too large for C int.", key);
if (int64 >= min_bound && int64 <= max_bound) {
goto return_int;
}
*int_pointer = int64_to_return;

return AEROSPIKE_OK;
if (warn_if_out_of_bounds) {
int retval = PyErr_WarnFormat(PyExc_DeprecationWarning, STACK_LEVEL,
OUT_OF_BOUNDS_MESSAGE, key, min_bound,
max_bound, int64);
if (retval == 0) {
goto return_int;
}
}

return as_error_update(err, AEROSPIKE_ERR_PARAM, OUT_OF_BOUNDS_MESSAGE, key,
min_bound, max_bound, int64);

return_int:
*int_pointer = int64;
exit_without_returning_int:
return err->code;
}

as_status get_enum_from_py_dict(as_error *err, const char *key,
PyObject *py_dict, int *int_pointer,
int min_bound, int max_bound, bool is_optional)
{
return get_bound_int_from_py_dict(err, key, py_dict, int_pointer, min_bound,
max_bound, is_optional, true);
}

as_status get_int_from_py_dict(as_error *err, const char *key,
PyObject *py_dict, int *int_pointer)
{
return get_bound_int_from_py_dict(err, key, py_dict, int_pointer, INT_MIN,
INT_MAX, false, false);
}

as_status get_list_return_type(as_error *err, PyObject *op_dict,
Expand Down
14 changes: 11 additions & 3 deletions src/main/client/operate.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "hll_operations.h"
#include "pythoncapi_compat.h"
#include "expression_operations.h"
#include "cdt_operation_utils.h"

#include <aerospike/as_double.h>
#include <aerospike/as_integer.h>
Expand Down Expand Up @@ -346,7 +347,6 @@ as_status add_op(AerospikeClient *self, as_error *err,
PyObject *py_map_policy = NULL;
PyObject *py_return_type = NULL;
// For map_create operation
PyObject *py_map_order = NULL;
PyObject *py_persist_index = NULL;

Py_ssize_t pos = 0;
Expand Down Expand Up @@ -419,7 +419,7 @@ as_status add_op(AerospikeClient *self, as_error *err,
ctx_ref = (ctx_in_use ? &ctx : NULL);
}
else if (strcmp(name, "map_order") == 0) {
py_map_order = value;
continue;
}
else if (strcmp(name, "persist_index") == 0) {
py_persist_index = value;
Expand Down Expand Up @@ -744,7 +744,15 @@ as_status add_op(AerospikeClient *self, as_error *err,
as_operations_map_set_policy(ops, bin, ctx_ref, &map_policy);
break;
case OP_MAP_CREATE:;
as_map_order order = (as_map_order)PyLong_AsLong(py_map_order);
int tmp_value;
if (get_enum_from_py_dict(err, "map_order", py_operation_dict,
&tmp_value, AS_MAP_UNORDERED,
AS_MAP_KEY_VALUE_ORDERED,
false) != AEROSPIKE_OK) {
return err->code;
}
as_map_order order = (as_map_order)tmp_value;

bool persist_index = PyObject_IsTrue(py_persist_index);
as_operations_map_create_all(ops, bin, ctx_ref, order, persist_index);
break;
Expand Down
39 changes: 22 additions & 17 deletions src/main/client/operate_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,17 @@ as_status as_operations_add_from_pyobject(AerospikeClient *self, as_error *err,
break;
}

int64_t order_type_int;
as_list_order list_order = AS_LIST_UNORDERED;
int tmp_value;
switch (operation_code) {
case OP_LIST_SET_ORDER:
case OP_LIST_CREATE:
if (get_int64_t(err, AS_PY_LIST_ORDER, op_dict, &order_type_int) !=
AEROSPIKE_OK) {
if (get_enum_from_py_dict(err, AS_PY_LIST_ORDER, op_dict, &tmp_value,
AS_LIST_UNORDERED, AS_LIST_ORDERED,
false) != AEROSPIKE_OK) {
goto exit;
}
list_order = (as_list_order)tmp_value;
}

bool ctx_in_use = false;
Expand Down Expand Up @@ -330,20 +333,22 @@ as_status as_operations_add_from_pyobject(AerospikeClient *self, as_error *err,

as_string_numeric_type numeric_type = AS_STRING_NUMERIC_ANY;
as_string_regex_flags regex_flags = AS_STRING_REGEX_FLAGS_NONE;
int64_t tmp_value;
switch (operation_code) {
case OP_STRING_IS_NUMERIC: {
if (get_int64_t(err, "numeric_type", op_dict, &tmp_value) !=
AEROSPIKE_OK) {
if (get_enum_from_py_dict(
err, "numeric_type", op_dict, &tmp_value, AS_STRING_NUMERIC_ANY,
AS_STRING_NUMERIC_FLOAT, false) != AEROSPIKE_OK) {
goto CLEANUP_VAL2_ON_ERROR;
}
numeric_type = (as_string_numeric_type)tmp_value;
break;
}
case OP_STRING_REGEX_COMPARE:
case OP_STRING_REGEX_REPLACE: {
if (get_int64_t(err, "regex_flags", op_dict, &tmp_value) !=
AEROSPIKE_OK) {
if (get_enum_from_py_dict(err, "regex_flags", op_dict, &tmp_value,
AS_STRING_REGEX_FLAGS_NONE,
AS_STRING_REGEX_FLAGS_GLOBAL * 2 - 1,
false) != AEROSPIKE_OK) {
goto CLEANUP_VAL2_ON_ERROR;
}
regex_flags = (as_string_regex_flags)tmp_value;
Expand Down Expand Up @@ -557,18 +562,19 @@ as_status as_operations_add_from_pyobject(AerospikeClient *self, as_error *err,
ops, bin, ctx_ref, val1, val2, return_type);
break;
case OP_LIST_SET_ORDER:
success = as_operations_list_set_order(ops, bin, ctx_ref,
(as_list_order)order_type_int);
success = as_operations_list_set_order(ops, bin, ctx_ref, list_order);
break;
case OP_LIST_SORT: {
int64_t sort_flags;
as_list_sort_flags sort_flags;

if (get_int64_t(err, AS_PY_LIST_SORT_FLAGS, op_dict, &sort_flags) !=
AEROSPIKE_OK) {
if (get_enum_from_py_dict(err, AS_PY_LIST_SORT_FLAGS, op_dict,
&tmp_value, AS_LIST_SORT_DEFAULT,
AS_LIST_SORT_DROP_DUPLICATES,
false) != AEROSPIKE_OK) {
goto CLEANUP_VAL2_ON_ERROR;
}
success = as_operations_list_sort(ops, bin, ctx_ref,
(as_list_sort_flags)sort_flags);
sort_flags = (as_list_sort_flags)tmp_value;
success = as_operations_list_sort(ops, bin, ctx_ref, sort_flags);
break;
}
case OP_LIST_GET_BY_VALUE_RANK_RANGE_REL:
Expand All @@ -593,8 +599,7 @@ as_status as_operations_add_from_pyobject(AerospikeClient *self, as_error *err,
goto CLEANUP_VAL2_ON_ERROR;
}

success = as_operations_list_create_all(ops, bin, ctx_ref,
(as_list_order)order_type_int,
success = as_operations_list_create_all(ops, bin, ctx_ref, list_order,
pad, persist_index);
break;
}
Expand Down
10 changes: 6 additions & 4 deletions src/main/conversions.c
Original file line number Diff line number Diff line change
Expand Up @@ -2640,8 +2640,9 @@ as_status as_cdt_ctx_add_from_pyobject(AerospikeClient *self, as_error *err,
break;
case CDT_CTX_MAP_KEY_CREATE:;
int map_order = 0;
status = get_int_from_py_dict(err, CDT_CTX_ORDER_KEY, py_extra_args,
&map_order);
status = get_enum_from_py_dict(err, CDT_CTX_ORDER_KEY, py_extra_args,
&map_order, AS_MAP_UNORDERED,
AS_MAP_KEY_VALUE_ORDERED, false);
if (status != AEROSPIKE_OK) {
goto CLEANUP_PY_EXTRA_ARGS;
}
Expand All @@ -2664,8 +2665,9 @@ as_status as_cdt_ctx_add_from_pyobject(AerospikeClient *self, as_error *err,
case CDT_CTX_LIST_INDEX_CREATE:;
int list_order = 0;
int pad = 0;
status = get_int_from_py_dict(err, CDT_CTX_ORDER_KEY, py_extra_args,
&list_order);
status = get_enum_from_py_dict(err, CDT_CTX_ORDER_KEY, py_extra_args,
&list_order, AS_LIST_UNORDERED,
AS_LIST_ORDERED, false);
if (status != AEROSPIKE_OK) {
goto CLEANUP_PY_EXTRA_ARGS;
}
Expand Down
23 changes: 15 additions & 8 deletions src/main/convert_expressions.c
Original file line number Diff line number Diff line change
Expand Up @@ -1048,15 +1048,18 @@ add_expr_macros(AerospikeClient *self, as_static_pool *static_pool,
APPEND_ARRAY(1, as_exp_list_clear(temp_expr->ctx,
NIL)); // -1 for bin
break;
case OP_LIST_SORT:
if (get_int64_t(err, LIST_ORDER_KEY, temp_expr->pydict, &lval1) !=
AEROSPIKE_OK) {
case OP_LIST_SORT: {
int tmp_value;
if (get_enum_from_py_dict(err, LIST_ORDER_KEY, temp_expr->pydict,
&tmp_value, AS_LIST_UNORDERED,
AS_LIST_ORDERED, false) != AEROSPIKE_OK) {
return err->code;
}

APPEND_ARRAY(1, as_exp_list_sort(temp_expr->ctx, lval1,
APPEND_ARRAY(1, as_exp_list_sort(temp_expr->ctx, tmp_value,
NIL)); // -1 for bin
break;
}
case OP_LIST_REMOVE_BY_VALUE:
if (get_int64_t(err, AS_PY_LIST_RETURN_KEY, temp_expr->pydict,
&lval1) != AEROSPIKE_OK) {
Expand Down Expand Up @@ -1482,14 +1485,18 @@ add_expr_macros(AerospikeClient *self, as_static_pool *static_pool,
temp_expr->ctx, lval1, NIL, NIL,
NIL)); // - 3 for rank, count, bin
break;
case _AS_EXP_BIT_FLAGS:
if (get_int64_t(err, AS_PY_VAL_KEY, temp_expr->pydict, &lval1) !=
AEROSPIKE_OK) {
case _AS_EXP_BIT_FLAGS: {
int tmp_value;
if (get_enum_from_py_dict(err, AS_PY_VAL_KEY, temp_expr->pydict,
&tmp_value, AS_BIT_RESIZE_DEFAULT,
AS_BIT_RESIZE_SHRINK_ONLY * 2 - 1,
false) != AEROSPIKE_OK) {
return err->code;
}

APPEND_ARRAY(0, as_exp_uint((uint64_t)lval1));
APPEND_ARRAY(0, as_exp_uint(tmp_value));
break;
}
case OP_BIT_RESIZE:
APPEND_ARRAY(4, as_exp_bit_resize(
NULL, NIL, NO_BIT_FLAGS,
Expand Down
Loading
Loading