Skip to content

Commit e81f62d

Browse files
[CLIENT-3476] Fix "compress" base policy option not being applied to config-level policies (#931)
1 parent 4fd4f83 commit e81f62d

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/main/policy_config.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,12 @@ as_status set_base_policy(as_policy_base *base_policy, PyObject *py_policy)
950950
return status;
951951
}
952952

953+
status = set_optional_bool_property((bool *)&base_policy->compress,
954+
py_policy, "compress");
955+
if (status != AEROSPIKE_OK) {
956+
return status;
957+
}
958+
953959
return AEROSPIKE_OK;
954960
}
955961

test/new_tests/test_client_config_level_options.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,19 @@ def test_setting_rack_aware():
173173
aerospike.client(config)
174174

175175

176+
@pytest.mark.parametrize(
177+
"compress, expected_cm",
178+
[
179+
(True, nullcontext()),
180+
(0.2, pytest.raises(e.ParamError))
181+
]
182+
)
183+
def test_setting_compress(compress, expected_cm):
184+
config = copy.deepcopy(gconfig)
185+
config["policies"]["read"]["compress"] = compress
186+
with expected_cm:
187+
aerospike.client(config)
188+
176189
def test_setting_batch_remove_gen():
177190
config = copy.deepcopy(gconfig)
178191
config["policies"]["batch_remove"] = {

0 commit comments

Comments
 (0)