Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
9733eed
reuse transaction level read policy
juliannguyen4 Jan 14, 2025
569274c
policy.h requires types.h
juliannguyen4 Jan 14, 2025
27cebab
initialize?
juliannguyen4 Jan 14, 2025
c85eccd
Merge remote-tracking branch 'origin/dev' into CLIENT-3106-global-con…
juliannguyen4 Apr 24, 2025
cac3634
Merge remote-tracking branch 'origin/dev' into CLIENT-3106-global-con…
juliannguyen4 May 19, 2025
4aa3282
wip
juliannguyen4 May 20, 2025
68cfd9d
only set txn and expression fields if we are initializing a txn-level…
juliannguyen4 May 20, 2025
46a56c3
make more readable
juliannguyen4 May 20, 2025
3bdbca3
wip
juliannguyen4 May 20, 2025
9e218bb
temp fix
juliannguyen4 May 20, 2025
3503c71
also do for write policy
juliannguyen4 May 20, 2025
7f99d52
now unused
juliannguyen4 May 20, 2025
b0bcc0a
do for apply
juliannguyen4 May 20, 2025
63b79b4
fix
juliannguyen4 May 20, 2025
9b1c044
fix
juliannguyen4 May 20, 2025
c43d226
wip. not done
juliannguyen4 May 20, 2025
cdf4f78
wip. remove unnecessary args because we can already access them thru …
juliannguyen4 May 20, 2025
df7795d
finish refactor work for write, apply, and read policies
juliannguyen4 May 21, 2025
32fe496
make consistent with c client api. fix
juliannguyen4 May 21, 2025
5e8618a
reorg
juliannguyen4 May 21, 2025
14d6c08
fix
juliannguyen4 May 21, 2025
c1ec158
Merge remote-tracking branch 'origin/dev' into CLIENT-3106-global-con…
juliannguyen4 May 21, 2025
1a63620
first round revisions
juliannguyen4 May 21, 2025
9eeaee6
fix
juliannguyen4 May 21, 2025
a5fcb6f
wip
juliannguyen4 May 21, 2025
6c5d093
just validate pyobject in helper function, since we arent doing it el…
juliannguyen4 May 21, 2025
835815a
add a useful comment.
juliannguyen4 May 21, 2025
97aa4a0
revert
juliannguyen4 May 21, 2025
f213a65
revert
juliannguyen4 May 21, 2025
284eec3
prevent undefined behavior
juliannguyen4 May 21, 2025
8bfb080
fix
juliannguyen4 May 21, 2025
bbb82df
fix
juliannguyen4 May 21, 2025
f04bd2d
wrong order
juliannguyen4 May 21, 2025
57f9f41
missing validation
juliannguyen4 May 21, 2025
77fe707
fix
juliannguyen4 May 22, 2025
7d02641
fix
juliannguyen4 May 22, 2025
1cec276
key being overwritten
juliannguyen4 May 22, 2025
c7cbfc1
Revert "key being overwritten"
juliannguyen4 May 23, 2025
eee5b0c
this should not be handled here
juliannguyen4 May 23, 2025
8470c89
Merge remote-tracking branch 'origin/dev' into CLIENT-3106-global-con…
juliannguyen4 May 27, 2025
97632cc
Merge remote-tracking branch 'origin/dev' into CLIENT-3106-global-con…
juliannguyen4 Jul 15, 2025
6cbd98a
clear up
juliannguyen4 Jul 15, 2025
a458fcf
clear up
juliannguyen4 Jul 15, 2025
c701fa5
comment
juliannguyen4 Jul 15, 2025
4709edb
revise
juliannguyen4 Jul 15, 2025
6ff8b3c
rm confusing comment
juliannguyen4 Jul 15, 2025
c3fb975
more todo
juliannguyen4 Jul 15, 2025
1c1187b
wip
juliannguyen4 Jul 15, 2025
bc1e6a0
Merge remote-tracking branch 'origin/dev' into CLIENT-3106-global-con…
juliannguyen4 Aug 18, 2025
d3908e4
Merge remote-tracking branch 'origin/dev' into CLIENT-3106-global-con…
juliannguyen4 Oct 2, 2025
441e3cc
fix
juliannguyen4 Oct 2, 2025
95e5e3f
set helper method shouldnt need to return the object it is setting at…
juliannguyen4 Oct 2, 2025
83e5efa
fix
juliannguyen4 Oct 2, 2025
0139a71
Merge remote-tracking branch 'origin/dev' into CLIENT-3106-global-con…
juliannguyen4 Oct 2, 2025
4647b94
Try using inline function to check if py_policy is correct type inste…
juliannguyen4 Oct 2, 2025
529e5fc
Improve naming to make less confusing
juliannguyen4 Oct 3, 2025
ce4f873
explain..
juliannguyen4 Oct 3, 2025
e498791
Rm duplicate policy type check since policy set functions already che…
juliannguyen4 Oct 3, 2025
c9f48b4
move to proper section
juliannguyen4 Oct 3, 2025
ef25215
experiment with converter function to convert python type to as_policy_*
juliannguyen4 Oct 3, 2025
c4abe37
See if these two test cases pass now.
juliannguyen4 Oct 3, 2025
821d32a
Revert "experiment with converter function to convert python type to …
juliannguyen4 Oct 3, 2025
afb3420
Merge remote-tracking branch 'origin/dev' into CLIENT-3106-global-con…
juliannguyen4 Oct 28, 2025
196a4c7
Fix merge
juliannguyen4 Oct 28, 2025
f77e180
fix
juliannguyen4 Oct 28, 2025
17e798a
fix
juliannguyen4 Oct 28, 2025
a2551e6
fix
juliannguyen4 Oct 28, 2025
6a7d53c
fix
juliannguyen4 Oct 28, 2025
68790a9
fix
juliannguyen4 Oct 28, 2025
f20f7d1
Fix
juliannguyen4 Oct 28, 2025
04630c6
fix
juliannguyen4 Oct 28, 2025
5377d79
fix
juliannguyen4 Oct 28, 2025
13c9156
Merge remote-tracking branch 'origin/dev' into CLIENT-3106-global-con…
juliannguyen4 Nov 4, 2025
0d5a730
Remove duplicate include
juliannguyen4 Nov 4, 2025
fc50d4c
Fix
juliannguyen4 Nov 4, 2025
5ec11bf
Revert to old behavior to stop tests from regressing
juliannguyen4 Nov 4, 2025
aee0fbb
Forgot to revert
juliannguyen4 Nov 4, 2025
d48bb11
Also another possible exc
juliannguyen4 Nov 4, 2025
47dfb3e
Resetting error after validating keys doesn't make sense because we w…
juliannguyen4 Nov 4, 2025
63bb75f
Merge remote-tracking branch 'origin/dev' into CLIENT-3106-global-con…
juliannguyen4 Nov 5, 2025
42bbd78
Clean up redundant part of test. This part has nothing to do with the…
juliannguyen4 Nov 5, 2025
c6c8949
Final naming
juliannguyen4 Nov 6, 2025
e7b6ccc
Revert "Final naming"
juliannguyen4 Nov 6, 2025
1aee1e9
Fix regression where using client config read policy with POLICY_KEY_…
juliannguyen4 Nov 7, 2025
c93d924
Add back. not sure how this went missing
juliannguyen4 Nov 7, 2025
fe1e2a6
fix comment
juliannguyen4 Nov 7, 2025
84882df
Comment better
juliannguyen4 Nov 7, 2025
c5088d0
comment
juliannguyen4 Nov 7, 2025
9074b46
Dont need to wrap this around do while since it's not going to be cal…
juliannguyen4 Nov 7, 2025
df9a960
Remove unused inline func
juliannguyen4 Nov 7, 2025
4dce0e6
Use helper function from compatibility header
juliannguyen4 Nov 7, 2025
b0b1c1d
improve naming.
juliannguyen4 Nov 7, 2025
82195ca
fix
juliannguyen4 Nov 7, 2025
8ddb54c
Fix
juliannguyen4 Nov 7, 2025
0cb1da5
not needed unless something before is not resetting error
juliannguyen4 Nov 7, 2025
bb4ce90
Refactor
juliannguyen4 Nov 7, 2025
277612c
fix
juliannguyen4 Nov 7, 2025
6aa561f
Fix
juliannguyen4 Nov 7, 2025
c283860
It should be fine to change the error message. the same exception is …
juliannguyen4 Nov 7, 2025
7565cbc
fix mem leaks
juliannguyen4 Nov 7, 2025
7243fd5
TODO WIP: remove exp_list_p and exp_list parameters since we can acce…
juliannguyen4 Nov 7, 2025
07e367d
WIP. todo check that this is good practice..
juliannguyen4 Nov 7, 2025
ebaef29
WIP removing filter_exp arguments and variables. TODO not sure if fre…
juliannguyen4 Nov 10, 2025
83acbb4
Merge remote-tracking branch 'origin/dev' into CLIENT-3106-global-con…
juliannguyen4 Dec 5, 2025
b02c12d
Merge remote-tracking branch 'origin/dev' into CLIENT-3106-global-con…
juliannguyen4 Apr 6, 2026
147d1e3
Merge remote-tracking branch 'origin/dev' into CLIENT-3106-global-con…
juliannguyen4 Jun 19, 2026
ac7563b
Merge remote-tracking branch 'origin/dev' into CLIENT-3106-global-con…
juliannguyen4 Jul 10, 2026
4ffdf95
Address compiler error.
juliannguyen4 Jul 10, 2026
23f9cb9
Address compiler error. This should be the last of the errors from py…
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
105 changes: 72 additions & 33 deletions src/include/policy.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include <aerospike/as_metrics.h>
#include <aerospike/as_string_operations.h>

#include "types.h"

enum Aerospike_serializer_values {
SERIALIZER_NONE, /* default handler for serializer type */
SERIALIZER_PYTHON,
Expand Down Expand Up @@ -269,8 +271,7 @@ as_status pyobject_to_policy_admin(AerospikeClient *self, as_error *err,
as_status pyobject_to_policy_apply(AerospikeClient *self, as_error *err,
PyObject *py_policy, as_policy_apply *policy,
as_policy_apply **policy_p,
as_policy_apply *config_apply_policy,
as_exp **exp_list_p);
as_policy_apply *config_apply_policy);

typedef enum {
SECOND_AS_POLICY_WRITE,
Expand All @@ -288,49 +289,32 @@ pyobject_to_policy_info(as_error *err, PyObject *py_policy,
as_status pyobject_to_policy_query(AerospikeClient *self, as_error *err,
PyObject *py_policy, as_policy_query *policy,
as_policy_query **policy_p,
as_policy_query *config_query_policy,
as_exp **exp_list_p);

as_status pyobject_to_policy_read(AerospikeClient *self, as_error *err,
PyObject *py_policy, as_policy_read *policy,
as_policy_read **policy_p,
as_policy_read *config_read_policy,
as_exp **exp_list_p);
as_policy_query *config_query_policy);

as_status pyobject_to_policy_remove(AerospikeClient *self, as_error *err,
PyObject *py_policy,
as_policy_remove *policy,
as_policy_remove **policy_p,
as_policy_remove *config_remove_policy,
as_exp **exp_list_p);
as_policy_remove *config_remove_policy);

// py_policy_also_supports_info_policy_fields only applies if self->validate_keys is true
as_status
pyobject_to_policy_scan(AerospikeClient *self, as_error *err,
PyObject *py_policy, as_policy_scan *policy,
as_policy_scan **policy_p,
as_policy_scan *config_scan_policy, as_exp **exp_list_p,
as_policy_scan *config_scan_policy,
bool py_policy_also_supports_info_policy_fields);

// py_policy_also_supports_info_policy_fields only applies if self->validate_keys is true
as_status pyobject_to_policy_write(
AerospikeClient *self, as_error *err, PyObject *py_policy,
as_policy_write *policy, as_policy_write **policy_p,
as_policy_write *config_write_policy, as_exp **exp_list_p,
bool py_policy_also_supports_info_policy_fields);

as_status pyobject_to_policy_operate(AerospikeClient *self, as_error *err,
PyObject *py_policy,
as_policy_operate *policy,
as_policy_operate **policy_p,
as_policy_operate *config_operate_policy,
as_exp **exp_list_p);
as_policy_operate *config_operate_policy);

as_status pyobject_to_policy_batch(AerospikeClient *self, as_error *err,
PyObject *py_policy, as_policy_batch *policy,
as_policy_batch **policy_p,
as_policy_batch *config_batch_policy,
as_exp **exp_list_p);
as_policy_batch *config_batch_policy);

as_status pyobject_to_map_policy(as_error *err, PyObject *py_policy,
as_map_policy *policy, bool validate_keys);
Expand All @@ -352,27 +336,82 @@ as_status pyobject_to_hll_policy(as_error *err, PyObject *py_policy,
as_status pyobject_to_batch_write_policy(AerospikeClient *self, as_error *err,
PyObject *py_policy,
as_policy_batch_write *policy,
as_policy_batch_write **policy_p,
as_exp **exp_list_p);
as_policy_batch_write **policy_p);

as_status pyobject_to_batch_read_policy(AerospikeClient *self, as_error *err,
PyObject *py_policy,
as_policy_batch_read *policy,
as_policy_batch_read **policy_p,
as_exp **exp_list_p);
as_policy_batch_read **policy_p);

as_status pyobject_to_batch_apply_policy(AerospikeClient *self, as_error *err,
PyObject *py_policy,
as_policy_batch_apply *policy,
as_policy_batch_apply **policy_p,
as_exp **exp_list_p);
as_policy_batch_apply **policy_p);

as_status pyobject_to_batch_remove_policy(AerospikeClient *self, as_error *err,
PyObject *py_policy,
as_policy_batch_remove *policy,
as_policy_batch_remove **policy_p,
as_exp **exp_list_p);

as_policy_batch_remove **policy_p);

// These methods are used for setting config-level policies and are re-used for the helper methods
// that set transaction-level policies.
//
// Overrides an as_policy_* *policy* fields using entries from a Python object *py_policy*.
//
// *policy* must point to a valid as_policy_* instance.
//
// If py_policy is NULL, do nothing. Else if it is not a Python dictionary, an error will be raised.
// (We check if it's a dictionary here because *py_policy*'s type is not validated when parsing API arguments)
//
// We only need the AerospikeClient *self* for parsing Python client expressions and to tell whether to validate keys.
//
// *is_this_txn_policy* is required because there are fields that should only be set in *policy* for txn-level
// policies.
//
// Returns AEROSPIKE_OK on success or another status code on error. On error, the err argument is populated.

as_status as_policy_read_set_from_pyobject(AerospikeClient *self, as_error *err,
PyObject *py_policy,
as_policy_read *policy,
bool is_policy_txn_level);

as_status as_policy_write_set_from_pyobject(AerospikeClient *self,
as_error *err, PyObject *py_policy,
as_policy_write *policy,
bool is_policy_txn_level);

as_status as_policy_apply_set_from_pyobject(AerospikeClient *self,
as_error *err, PyObject *py_policy,
as_policy_apply *policy,
bool is_policy_txn_level);

// These methods are used for setting transaction level policies
// 1. Copies an config-level as_policy_* *src* to a txn-level *dst* policy
// 2. Sets an as_policy_* *dst* from a Python object *py_policy*. to override the defaults from *src*
// *py_policy* must be a Python dictionary, and *src* and *dst* must point to valid as_policy_* instances.
// We only need the AerospikeClient *self* for parsing Python client expressions and to tell whether to validate keys.
//
// Returns AEROSPIKE_OK on success or another status code on error. On error, the err argument is populated.

as_status as_policy_write_copy_and_set_from_pyobject(AerospikeClient *self,
as_error *err,
PyObject *py_policy,
as_policy_write *dst,
as_policy_write *src);

as_status as_policy_read_copy_and_set_from_pyobject(AerospikeClient *self,
as_error *err,
PyObject *py_policy,
as_policy_read *dst,
as_policy_read *src);

as_status as_policy_apply_copy_and_set_from_pyobject(AerospikeClient *self,
as_error *err,
PyObject *py_policy,
as_policy_apply *dst,
as_policy_apply *src);

// TODO: make consistent
// metrics_policy must be declared already
// py_metrics_policy must be non-NULL
// Returns non-zero integer value on error.
Expand Down
10 changes: 8 additions & 2 deletions src/include/policy_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <aerospike/as_config.h>

#include "macros.h"
#include "types.h"

as_status set_optional_uint32_property(uint32_t *target_ptr,
PyObject *policy_dict, const char *name);
Expand All @@ -39,10 +40,15 @@ as_status set_optional_gen(as_policy_gen *target_ptr, PyObject *py_policy,
as_status set_optional_exists(as_policy_exists *target_ptr, PyObject *py_policy,
const char *name);

// Although set_subpolicies is called by AerospikeClient's init method, and it takes in AerospikeClient as a param,
// it should be safe to use because set_subpolicies only reads from self->validate_keys in this case
// We know that self->validate_keys is initialized by the time we call this.
// TODO: refactor set_subpolicies to not depend on AerospikeClient
//
// This only sets the err object if an invalid dictionary key is passed
// On error, return an error code
as_status set_subpolicies(as_error *err, as_config *config,
PyObject *py_policies, int validate_keys);
as_status set_subpolicies(AerospikeClient *self, as_error *err,
as_config *config, PyObject *py_policies);
as_status set_read_policy(as_error *err, as_policy_read *read_policy,
PyObject *py_policy, int validate_keys);
as_status set_write_policy(as_error *err, as_policy_write *write_policy,
Expand Down
31 changes: 21 additions & 10 deletions src/main/client/apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ PyObject *AerospikeClient_Apply_Invoke(AerospikeClient *self, PyObject *py_key,
PyObject *py_umodule = NULL;
PyObject *py_ufunction = NULL;

// For converting expressions.
as_exp *exp_list_p = NULL;

as_static_pool static_pool;
memset(&static_pool, 0, sizeof(static_pool));
// Initialisation flags
Expand Down Expand Up @@ -108,11 +105,21 @@ PyObject *AerospikeClient_Apply_Invoke(AerospikeClient *self, PyObject *py_key,
}

// Convert python policy object to as_policy_apply
pyobject_to_policy_apply(self, &err, py_policy, &apply_policy,
&apply_policy_p, &self->as->config.policies.apply,
&exp_list_p);
if (err.code != AEROSPIKE_OK) {
goto CLEANUP;
// This is a double check if py_policy is NULL where as_policy_apply_set_from_pyobject
// also checks the same thing before setting the apply policy.
// But this is because for the client config dictionary, as_policy_apply_set_from_pyobject is the only
// place where we check if py_policy is NULL before setting apply policy.
//
// Also, I didn't want to set the pointer to the apply policy in this helper function as well to make
// the latter more simple
if (py_policy) {
as_policy_apply_copy_and_set_from_pyobject(
self, &err, py_policy, &apply_policy,
&self->as->config.policies.apply);
if (err.code != AEROSPIKE_OK) {
goto CLEANUP;
}
apply_policy_p = &apply_policy;
}

if (PyUnicode_Check(py_module)) {
Expand Down Expand Up @@ -147,8 +154,8 @@ PyObject *AerospikeClient_Apply_Invoke(AerospikeClient *self, PyObject *py_key,
}

CLEANUP:
if (exp_list_p) {
as_exp_destroy(exp_list_p);
if (apply_policy_p) {
as_exp_destroy(apply_policy_p->base.filter_exp);
}

if (py_umodule) {
Expand Down Expand Up @@ -209,6 +216,10 @@ PyObject *AerospikeClient_Apply(AerospikeClient *self, PyObject *args,
return NULL;
}

if (py_policy == Py_None) {
py_policy = NULL;
}

// Invoke Operation
return AerospikeClient_Apply_Invoke(self, py_key, py_module, py_function,
py_arglist, py_policy);
Expand Down
20 changes: 8 additions & 12 deletions src/main/client/batch_apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ static PyObject *AerospikeClient_Batch_Apply_Invoke(
as_batch_init(&batch, 0);

// For expressions conversion.
as_exp *batch_exp_list_p = NULL;
as_exp *batch_apply_exp_list_p = NULL;

PyObject *br_instance = NULL;

Expand Down Expand Up @@ -177,19 +175,17 @@ static PyObject *AerospikeClient_Batch_Apply_Invoke(
sizeof(as_key) * processed_key_count);

if (py_policy_batch) {
if (pyobject_to_policy_batch(self, err, py_policy_batch, &policy_batch,
&policy_batch_p,
&self->as->config.policies.batch,
&batch_exp_list_p) != AEROSPIKE_OK) {
if (pyobject_to_policy_batch(
self, err, py_policy_batch, &policy_batch, &policy_batch_p,
&self->as->config.policies.batch) != AEROSPIKE_OK) {
goto CLEANUP;
}
}

if (py_policy_batch_apply) {
if (pyobject_to_batch_apply_policy(
self, err, py_policy_batch_apply, &policy_batch_apply,
&policy_batch_apply_p,
&batch_apply_exp_list_p) != AEROSPIKE_OK) {
&policy_batch_apply_p) != AEROSPIKE_OK) {
goto CLEANUP;
}
}
Expand Down Expand Up @@ -270,12 +266,12 @@ static PyObject *AerospikeClient_Batch_Apply_Invoke(
as_list_destroy(arglist);
}

if (batch_exp_list_p) {
as_exp_destroy(batch_exp_list_p);
if (policy_batch_p) {
as_exp_destroy(policy_batch_p->base.filter_exp);
}

if (batch_apply_exp_list_p) {
as_exp_destroy(batch_apply_exp_list_p);
if (policy_batch_apply_p) {
as_exp_destroy(policy_batch_apply_p->filter_exp);
}

as_batch_destroy(&batch);
Expand Down
23 changes: 8 additions & 15 deletions src/main/client/batch_operate.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,6 @@ static PyObject *AerospikeClient_Batch_Operate_Invoke(
as_batch batch;
as_batch_init(&batch, 0);

// For expressions conversion.
as_exp *batch_exp_list_p = NULL;

as_exp *batch_write_exp_list_p = NULL;

as_vector *unicodeStrVector = as_vector_create(sizeof(char *), 128);

as_static_pool static_pool;
Expand Down Expand Up @@ -207,19 +202,17 @@ static PyObject *AerospikeClient_Batch_Operate_Invoke(
sizeof(as_key) * processed_key_count);

if (py_policy_batch) {
if (pyobject_to_policy_batch(self, err, py_policy_batch, &policy_batch,
&policy_batch_p,
&self->as->config.policies.batch,
&batch_exp_list_p) != AEROSPIKE_OK) {
if (pyobject_to_policy_batch(
self, err, py_policy_batch, &policy_batch, &policy_batch_p,
&self->as->config.policies.batch) != AEROSPIKE_OK) {
goto CLEANUP;
}
}

if (py_policy_batch_write) {
if (pyobject_to_batch_write_policy(
self, err, py_policy_batch_write, &policy_batch_write,
&policy_batch_write_p,
&batch_write_exp_list_p) != AEROSPIKE_OK) {
&policy_batch_write_p) != AEROSPIKE_OK) {
goto CLEANUP;
}
}
Expand Down Expand Up @@ -300,12 +293,12 @@ static PyObject *AerospikeClient_Batch_Operate_Invoke(
free(as_vector_get_ptr(unicodeStrVector, i));
}

if (batch_exp_list_p) {
as_exp_destroy(batch_exp_list_p);
if (policy_batch_p) {
as_exp_destroy(policy_batch_p->base.filter_exp);
}

if (batch_write_exp_list_p) {
as_exp_destroy(batch_write_exp_list_p);
if (policy_batch_write_p) {
as_exp_destroy(policy_batch_write_p->filter_exp);
}

as_vector_destroy(unicodeStrVector);
Expand Down
14 changes: 5 additions & 9 deletions src/main/client/batch_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,10 @@ PyObject *AerospikeClient_BatchRead(AerospikeClient *self, PyObject *args,
as_policy_batch policy_batch;
as_policy_batch *policy_batch_p = NULL;

// For expressions conversion.
as_exp *batch_exp_list_p = NULL;

if (py_policy_batch) {
if (pyobject_to_policy_batch(self, &err, py_policy_batch, &policy_batch,
&policy_batch_p,
&self->as->config.policies.batch,
&batch_exp_list_p) != AEROSPIKE_OK) {
if (pyobject_to_policy_batch(
self, &err, py_policy_batch, &policy_batch, &policy_batch_p,
&self->as->config.policies.batch) != AEROSPIKE_OK) {
goto CLEANUP3;
}
}
Expand Down Expand Up @@ -287,8 +283,8 @@ PyObject *AerospikeClient_BatchRead(AerospikeClient *self, PyObject *args,

as_batch_destroy(&batch);

if (batch_exp_list_p) {
as_exp_destroy(batch_exp_list_p);
if (policy_batch_p) {
as_exp_destroy(policy_batch_p->base.filter_exp);
}

CLEANUP2:
Expand Down
Loading
Loading