From 50b4b28ab3c2803f852c50b60e01a8060827bb56 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Wed, 20 May 2026 10:07:20 -0700 Subject: [PATCH 1/3] Address inaccurate description in client.query_apply() and Query class docstring --- doc/client.rst | 2 +- doc/query.rst | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/client.rst b/doc/client.rst index 329ab109b7..62a609539e 100755 --- a/doc/client.rst +++ b/doc/client.rst @@ -676,7 +676,7 @@ User Defined Functions This method blocks until the query is complete. :param str ns: the namespace in the aerospike cluster. - :param str set: the set name. Should be :py:obj:`None` if you want to query records in the *ns* which are in no set. + :param str set: the set name. Should be :py:obj:`None` if you want to query all records in the *ns* including ones that don't belong to a set. :param tuple predicate: the `tuple` produced by one of the :mod:`aerospike.predicates` methods. :param str module: the name of the UDF module. :param str function: the name of the UDF to apply to the records matched by the query. diff --git a/doc/query.rst b/doc/query.rst index cbcbed7e6e..6070bd600e 100755 --- a/doc/query.rst +++ b/doc/query.rst @@ -13,8 +13,7 @@ Constructing A Query -------------------- The query object is used for executing queries over a secondary index of a specified set. -It can be created by calling :meth:`aerospike.Client.query`. If the set is initialized to :py:obj:`None`, -then the query will only apply to records without a set. +It can be created by calling :meth:`aerospike.Client.query`. .. warning:: :meth:`aerospike.Query` should not be called directly to create a :class:`~aerospike.Query` object. From f270857e9a4e925ee4a199bb424aa687e2476468 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Wed, 20 May 2026 10:21:42 -0700 Subject: [PATCH 2/3] Make test case more accurate by checking all items in namespace were matched against predicate --- test/new_tests/test_query_apply.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/new_tests/test_query_apply.py b/test/new_tests/test_query_apply.py index 305e52e4c4..4cdd3c53af 100644 --- a/test/new_tests/test_query_apply.py +++ b/test/new_tests/test_query_apply.py @@ -168,7 +168,7 @@ def test_query_apply_with_set_argument_as_none(self): ) self._wait_for_query_complete(query_id) - self._items_without_set_have_been_applied() + self._correct_items_have_been_applied() def test_query_apply_with_incorrect_policy(self): """ From 2c7c9f7c83d17ebd4bd406492630c4e2148e61d0 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Wed, 20 May 2026 10:52:33 -0700 Subject: [PATCH 3/3] _correct_items_have_been_applied expects record without set to be ignored. --- test/new_tests/test_query_apply.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/new_tests/test_query_apply.py b/test/new_tests/test_query_apply.py index 4cdd3c53af..a8e2c28476 100644 --- a/test/new_tests/test_query_apply.py +++ b/test/new_tests/test_query_apply.py @@ -168,7 +168,7 @@ def test_query_apply_with_set_argument_as_none(self): ) self._wait_for_query_complete(query_id) - self._correct_items_have_been_applied() + self._all_ns_items_have_been_applied() def test_query_apply_with_incorrect_policy(self): """ @@ -476,14 +476,14 @@ def _correct_items_have_been_applied(self): _, _, bins = self.as_connection.get(self.no_set_key) assert bins["name"] != "aerospike" - def _items_without_set_have_been_applied(self): + def _all_ns_items_have_been_applied(self): for i in range(1, 10): key = ("test", "demo", i) _, _, bins = self.as_connection.get(key) - if TestBaseClass.major_ver < 6 or (TestBaseClass.major_ver == 6 and TestBaseClass.minor_ver == 0): - assert bins["name"] != "aerospike" + if i <= 4: + assert bins["name"] == "aerospike" else: - assert bins["name"] == "aerospike" or bins["name"] == str(i) + assert bins["name"] == str(i) _, _, bins = self.as_connection.get(self.no_set_key) assert bins["name"] == "aerospike"