Skip to content

Commit 6c49f69

Browse files
committed
Merge remote-tracking branch 'origin/stage' into CLIENT-5298-address-query-and-scan-foreach-and-results-possibly-missing-records-during-paginated-query-disruption
2 parents 338bc33 + 053ef20 commit 6c49f69

27 files changed

Lines changed: 295 additions & 76 deletions

.github/workflows/smoke-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ jobs:
268268
num-nodes: 1
269269
oidc-provider: ${{ vars.OIDC_PROVIDER_NAME }}
270270
oidc-audience: ${{ vars.OIDC_AUDIENCE }}
271-
server-tag: ${{ matrix.test == 'code-examples' && '8.1.3.0-35-20260629033923' || needs.get-env-vars.outputs.server-tag }}
271+
server-tag: ${{ matrix.test == 'code-examples' && '8.2.0.0-20260908214755' || needs.get-env-vars.outputs.server-tag }}
272272
server-container-repo: database-docker-virtual/aerospike-server${{ matrix.test == 'ee-code-examples' && '-enterprise' || '' }}
273273
tools-tag: 13.0.2_1
274274
config-file: ${{ (matrix.test == 'doctest' || matrix.test == 'ce-code-examples') && './.github/workflows/aerospike-ce.conf' || '' }}

aerospike_helpers/expressions/string.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
1919
These expressions mirror the operations from :mod:`String API <aerospike_helpers.operations.string_operations>`.
2020
21-
Requires server version 8.1.3 or later.
21+
Requires server version 8.2.0 or later.
2222
2323
Unlike operate-level string ops, these macros do not take a ``ctx`` parameter. To target
2424
a string nested inside a list or map, extract the leaf with

aerospike_helpers/operations/bitwise_operations.py

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@
148148
.. seealso:: `Bits (Data Types) <https://aerospike.com/docs/develop/data-types/blob#bitwise-operations>`_.
149149
"""
150150
import aerospike
151+
import warnings
152+
151153

152154
BIN_KEY = "bin"
153155
BYTE_SIZE_KEY = "byte_size"
@@ -229,14 +231,21 @@ def bit_set(bin_name: str, bit_offset, bit_size, value_byte_size, value, policy=
229231
bin_name (str): The name of the bin containing the map.
230232
bit_offset (int): The offset where the bits will be set.
231233
bit_size (int): How many bits of value to write.
232-
value_byte_size (int): Size of value in bytes.
234+
value_byte_size (int): Deprecated. Size of value in bytes.
235+
This is ignored and ``value``'s size is calculated automatically now.
233236
value (bytes, bytearray): The value to be set.
234237
policy (dict): The :ref:`bit_policy <aerospike_bit_policies>` dictionary. default: None.
235238
236239
Returns:
237240
A dictionary usable in operate or operate_ordered. The format of the dictionary
238241
should be considered an internal detail, and subject to change.
239242
"""
243+
warnings.warn(
244+
"value_byte_size is deprecated and will be removed in the next major client release",
245+
DeprecationWarning,
246+
stacklevel=2
247+
)
248+
240249
return {
241250
OP_KEY: aerospike.OP_BIT_SET,
242251
BIN_KEY: bin_name,
@@ -336,14 +345,21 @@ def bit_and(bin_name: str, bit_offset, bit_size, value_byte_size, value, policy=
336345
bin_name (str): The name of the bin containing the map.
337346
bit_offset (int): The offset where the bits will be modified.
338347
bit_size (int): How many bits of value to and.
339-
value_byte_size (int): Length of value in bytes.
348+
value_byte_size (int): Deprecated. Length of value in bytes.
349+
This is ignored and ``value``'s size is calculated automatically now.
340350
value (bytes, bytearray): Bytes to be used in and operation.
341351
policy (dict): The :ref:`bit_policy <aerospike_bit_policies>` dictionary. default: None.
342352
343353
Returns:
344354
A dictionary usable in :meth:`~aerospike.Client.operate` or :meth:`~aerospike.Client.operate_ordered`. The
345355
format of the dictionary should be considered an internal detail, and subject to change.
346356
"""
357+
warnings.warn(
358+
"value_byte_size is deprecated and will be removed in the next major client release",
359+
DeprecationWarning,
360+
stacklevel=2
361+
)
362+
347363
return {
348364
OP_KEY: aerospike.OP_BIT_AND,
349365
BIN_KEY: bin_name,
@@ -406,7 +422,8 @@ def bit_insert(bin_name: str, byte_offset, value_byte_size, value, policy=None):
406422
Args:
407423
bin_name (str): The name of the bin containing the map.
408424
byte_offset (int): The offset where the bytes will be inserted.
409-
value_byte_size (int): Size of value in bytes.
425+
value_byte_size (int): Deprecated. Size of value in bytes.
426+
This is ignored and ``value``'s size is calculated automatically now.
410427
value (bytes, bytearray): The value to be inserted.
411428
policy (dict): The :ref:`bit_policy <aerospike_bit_policies>` dictionary. default: None.
412429
@@ -415,6 +432,12 @@ def bit_insert(bin_name: str, byte_offset, value_byte_size, value, policy=None):
415432
A dictionary usable in :meth:`~aerospike.Client.operate` or :meth:`~aerospike.Client.operate_ordered`. The
416433
format of the dictionary should be considered an internal detail, and subject to change.
417434
"""
435+
warnings.warn(
436+
"value_byte_size is deprecated and will be removed in the next major client release",
437+
DeprecationWarning,
438+
stacklevel=2
439+
)
440+
418441
return {
419442
OP_KEY: aerospike.OP_BIT_INSERT,
420443
BIN_KEY: bin_name,
@@ -515,14 +538,21 @@ def bit_or(bin_name: str, bit_offset, bit_size, value_byte_size, value, policy=N
515538
bin_name (str): The name of the bin containing the map.
516539
bit_offset (int): The offset where the bits will start being compared.
517540
bit_size (int): How many bits of value to or.
518-
value_byte_size (int): Length of value in bytes.
541+
value_byte_size (int): Deprecated. Length of value in bytes.
542+
This is ignored and ``value``'s size is calculated automatically now.
519543
value (bytes | bytearray): Value to be used in or operation.
520544
policy (dict): The :ref:`bit_policy <aerospike_bit_policies>` dictionary. default: None.
521545
522546
Returns:
523547
A dictionary usable in :meth:`~aerospike.Client.operate` or :meth:`~aerospike.Client.operate_ordered`. The
524548
format of the dictionary should be considered an internal detail, and subject to change.
525549
"""
550+
warnings.warn(
551+
"value_byte_size is deprecated and will be removed in the next major client release",
552+
DeprecationWarning,
553+
stacklevel=2
554+
)
555+
526556
return {
527557
OP_KEY: aerospike.OP_BIT_OR,
528558
BIN_KEY: bin_name,
@@ -632,14 +662,21 @@ def bit_xor(bin_name: str, bit_offset, bit_size, value_byte_size, value, policy=
632662
bin_name (str): The name of the bin containing the map.
633663
bit_offset (int): The offset where the bits will start being compared.
634664
bit_size (int): How many bits of value to xor.
635-
value_byte_size (int): Length of value in bytes.
665+
value_byte_size (int): Deprecated. Length of value in bytes.
666+
This is ignored and ``value``'s size is calculated automatically now.
636667
value (bytes | bytearray): Value to be used in xor operation.
637668
policy (dict): The :ref:`bit_policy <aerospike_bit_policies>` dictionary. default: None.
638669
639670
Returns:
640671
A dictionary usable in :meth:`~aerospike.Client.operate` or :meth:`~aerospike.Client.operate_ordered`. The
641672
format of the dictionary should be considered an internal detail, and subject to change.
642673
"""
674+
warnings.warn(
675+
"value_byte_size is deprecated and will be removed in the next major client release.",
676+
DeprecationWarning,
677+
stacklevel=2
678+
)
679+
643680
return {
644681
OP_KEY: aerospike.OP_BIT_XOR,
645682
BIN_KEY: bin_name,
@@ -661,7 +698,7 @@ def bit_b64_encode(
661698
"""
662699
Create bit "b64 encode" operation that returns the base64 text of ``byte_size`` bytes starting from ``byte_offset``.
663700
664-
Requires server version 8.1.3 or later.
701+
Requires server version 8.2.0 or later.
665702
666703
Args:
667704
bin_name (str): The name of the bin containing the map.

aerospike_helpers/operations/list_operations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ def list_join(
11781178
An empty list yields an empty string, and a single-item list yields that item with no separator applied.
11791179
This is the inverse of :py:meth:`~aerospike_helpers.operations.string_operations.split_separator`.
11801180
1181-
Requires server version 8.1.3 or later.
1181+
Requires server version 8.2.0 or later.
11821182
11831183
Args:
11841184
bin_name (str): The name of the bin containing the list.
@@ -1192,7 +1192,7 @@ def list_join(
11921192
format of the dictionary should be considered an internal detail, and subject to change.
11931193
11941194
Note:
1195-
This operation requires server version 8.1.3.0 or greater.
1195+
This operation requires server version 8.2.0 or greater.
11961196
"""
11971197
op_dict = {
11981198
OP_KEY: aerospike._OP_LIST_JOIN,

aerospike_helpers/operations/string_operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
Negative indexes count from the end of the string (-1 is the last
2222
codepoint). Out-of-bounds indexes are clamped by the server.
2323
24-
String operations require server version 8.1.3 or later. When ctx is not
24+
String operations require server version 8.2.0 or later. When ctx is not
2525
:py:obj:`None` and not empty, the operation targets a string nested inside a list or
2626
map. The ctx-navigated leaf must already be an Aerospike string; operations
2727
on non-string leaves return :exc:`~aerospike.exception.BinIncompatibleType`.

doc/aerospike.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,14 @@ Only the `hosts` key is required; the rest of the keys are optional.
515515
Traceback (most recent call last):
516516
aerospike.exception.ParamError: "key_policy" is an invalid policy dictionary key
517517

518+
.. note::
519+
**Known exception:** :meth:`~aerospike.Client.remove_bin` raises
520+
:py:class:`~aerospike.exception.ClientError` instead of
521+
:py:class:`~aerospike.exception.ParamError` for an invalid policy
522+
dictionary key. This is scheduled to be fixed in the next major
523+
client release; see :meth:`~aerospike.Client.remove_bin` for
524+
details.
525+
518526
* **hosts** (:class:`list`)
519527
A list identifying a node (or multiple nodes) in the cluster. Each entry may be
520528
either a tuple or a string.

doc/client.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,16 @@ Record Commands
493493

494494
:raises: a subclass of :exc:`~aerospike.exception.AerospikeError`.
495495

496+
.. note::
497+
**Known issue:** if the client config's ``validate_keys`` option is :py:obj:`True` and
498+
*policy* contains an invalid dictionary key, this method raises
499+
:py:class:`~aerospike.exception.ClientError` instead of the
500+
:py:class:`~aerospike.exception.ParamError` that every other method raises in this
501+
situation (see :func:`aerospike.client`'s ``validate_keys`` option). Changing this
502+
outright would be a breaking change, so it is deferred to the next major client
503+
release. A :exc:`DeprecationWarning` is raised in the meantime to warn ahead of that
504+
change.
505+
496506
.. testcode::
497507

498508
# Insert record

pyproject.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,15 @@ dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"
5858
distance-dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"
5959
# Example formatted version: 1.2.3+42.ge174a1f.dirty
6060

61-
# These operations are still supported in server < 8.1.3,
62-
# and these operations are used in many places throughout the test suite.
6361
[tool.pytest.ini_options]
6462
filterwarnings = [
63+
# These operations are still supported in server < 8.2.0,
64+
# and these operations are used in many places throughout the test suite.
6565
"ignore:.*aerospike_helpers\\.operations\\.operations\\.append.*string.*:DeprecationWarning",
6666
"ignore:.*aerospike_helpers\\.operations\\.operations\\.prepend.*string.*:DeprecationWarning",
67+
"ignore:.*aerospike_helpers\\.operations\\.bitwise_operations\\.bit_xor.*value_byte_size.*:DeprecationWarning",
68+
"ignore:.*aerospike_helpers\\.operations\\.bitwise_operations\\.bit_and.*value_byte_size.*:DeprecationWarning",
69+
"ignore:.*aerospike_helpers\\.operations\\.bitwise_operations\\.bit_insert.*value_byte_size.*:DeprecationWarning",
70+
"ignore:.*aerospike_helpers\\.operations\\.bitwise_operations\\.bit_or.*value_byte_size.*:DeprecationWarning",
71+
"ignore:.*aerospike_helpers\\.operations\\.bitwise_operations\\.bit_xor.*value_byte_size.*:DeprecationWarning",
6772
]

src/include/client.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,3 +597,12 @@ PyObject *AerospikeClient_Abort(AerospikeClient *self, PyObject *args,
597597
"Operations and bin names are mutually exclusive." \
598598
"In the next major client release, when this %s object is executed, a " \
599599
"ParamError will be raised."
600+
601+
// remove_bin() raises ClientError instead of ParamError when validate_keys
602+
// is True and an invalid policy dictionary key is passed. Fixing this
603+
// outright would be a breaking change, so for now we keep the existing
604+
// (incorrect) behavior and just warn ahead of the next major release.
605+
#define REMOVE_BIN_INVALID_POLICY_KEY_MESSAGE \
606+
"remove_bin() raised a ClientError because the policy dictionary " \
607+
"contained an invalid key. In the next major client release, a " \
608+
"ParamError will be raised instead."

src/include/policy.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ enum Aerospike_send_bool_as_values {
6868
X(LIST_JOIN_SEPARATOR)
6969

7070
// clang-format off
71-
#define STRING_OP_NAMES \
72-
X(STRING_STRLEN), \
71+
#define STRING_OP_NAMES_EXCEPT_STRLEN \
7372
X(STRING_SUBSTR), \
7473
X(STRING_SUBSTR_RANGE), \
7574
X(STRING_CHAR_AT), \
@@ -114,7 +113,8 @@ enum {
114113
#define X(op_name) OP_##op_name
115114
X(LIST_APPEND) = 1001,
116115
LIST_OP_NAMES_EXCEPT_LIST_APPEND,
117-
STRING_OP_NAMES
116+
X(STRING_STRLEN) = 1200,
117+
STRING_OP_NAMES_EXCEPT_STRLEN
118118
#undef X
119119
};
120120

0 commit comments

Comments
 (0)