148148.. seealso:: `Bits (Data Types) <https://aerospike.com/docs/develop/data-types/blob#bitwise-operations>`_.
149149"""
150150import aerospike
151+ import warnings
152+
151153
152154BIN_KEY = "bin"
153155BYTE_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.
0 commit comments