From 156ee69612034b06009066f927e95cbe9ca572e9 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Sun, 26 Apr 2026 09:59:10 -0700 Subject: [PATCH 1/9] Replace a few constants with cross refs. Leave TODO's for later --- aerospike_helpers/operations/bitwise_operations.py | 2 ++ aerospike_helpers/operations/map_operations.py | 9 +++++---- doc/aerospike.rst | 4 +++- doc/client.rst | 4 +++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/aerospike_helpers/operations/bitwise_operations.py b/aerospike_helpers/operations/bitwise_operations.py index f0677bbe28..32d283a273 100644 --- a/aerospike_helpers/operations/bitwise_operations.py +++ b/aerospike_helpers/operations/bitwise_operations.py @@ -167,6 +167,8 @@ def bit_resize(bin_name: str, byte_size, policy=None, resize_flags: int = 0): bin_name (str): The name of the bin containing the map. byte_size (int): The new size of the bytes. policy (dict): The :ref:`bit_policy ` dictionary. default: None. + # TODO: this is the only method referencing these flags, but should document explicitly that + # the flags can be bitwise OR'd together. resize_flags (int): :ref:`aerospike_bitwise_resize_flag` modifying the resize behavior (default ``aerospike.BIT_RESIZE_DEFAULT``), such as ``aerospike.BIT_RESIZE_GROW_ONLY | aerospike.BIT_RESIZE_FROM_FRONT``. diff --git a/aerospike_helpers/operations/map_operations.py b/aerospike_helpers/operations/map_operations.py index 32f62df5d5..c17a35c896 100755 --- a/aerospike_helpers/operations/map_operations.py +++ b/aerospike_helpers/operations/map_operations.py @@ -968,7 +968,8 @@ def map_remove_by_value_rank_range_relative( Note: This operation requires server version 4.3.0 or greater. - Examples for a key ordered map ``{0: 6, 6: 12, 10: 18, 15: 24}`` and return type of ``aerospike.MAP_RETURN_KEY``: + Examples for a key ordered map ``{0: 6, 6: 12, 10: 18, 15: 24}`` and return type of + :py:data:`aerospike.MAP_RETURN_KEY`: :: @@ -1041,7 +1042,7 @@ def map_get_by_value_rank_range_relative( Note: This operation requires server version 4.3.0 or greater. - Examples for map ``{0: 6, 10: 18, 6: 12, 15: 24}`` and return type of ``aerospike.MAP_RETURN_KEY``. + Examples for map ``{0: 6, 10: 18, 6: 12, 15: 24}`` and return type of :py:data:`aerospike.MAP_RETURN_KEY`. See :meth:`map_remove_by_value_rank_range_relative` for in-depth explanation. :: @@ -1101,7 +1102,7 @@ def map_remove_by_key_index_range_relative( should be considered an internal detail, and subject to change. Examples for a key ordered map ``{0: 6, 6: 12, 10: 18, 15: 24}`` - and return type of ``aerospike.MAP_RETURN_KEY`` + and return type of :py:data:`aerospike.MAP_RETURN_KEY` :: @@ -1175,7 +1176,7 @@ def map_get_by_key_index_range_relative( This operation requires server version 4.3.0 or greater. Examples for a key ordered map ``{0: 6, 6: 12, 10: 18, 15: 24}`` - and return type of ``aerospike.MAP_RETURN_KEY``. + and return type of :py:data:`aerospike.MAP_RETURN_KEY`. See :meth:`map_remove_by_key_index_range_relative` for in-depth explanation. :: diff --git a/doc/aerospike.rst b/doc/aerospike.rst index 3e4571a7c4..111d1a3083 100644 --- a/doc/aerospike.rst +++ b/doc/aerospike.rst @@ -11,7 +11,7 @@ Overview :platform: 64-bit Linux and OS X :synopsis: Aerospike client for Python. -``aerospike`` is a package which provides a Python client for Aerospike database clusters. +:py:mod:`aerospike` is a package which provides a Python client for Aerospike database clusters. The Aerospike client enables you to build an application in Python with an Aerospike cluster as its database. The client manages the connections to the @@ -140,6 +140,8 @@ Types A type for distinguishing a server-side null from a Python :py:obj:`None`. Replaces the constant ``aerospike.null``. + .. Needs cross reference to server docs + :return: a type representing the server-side type ``as_null``. .. versionadded:: 2.0.1 diff --git a/doc/client.rst b/doc/client.rst index 329ab109b7..7ca4a3009d 100755 --- a/doc/client.rst +++ b/doc/client.rst @@ -483,7 +483,9 @@ Numeric Operations :param int offset: the value by which to increment the value in *bin*. :type offset: :py:class:`int` or :py:class:`float` :param dict meta: record metadata to be set. See :ref:`metadata_dict`. - :param dict policy: optional :ref:`aerospike_operate_policies`. Note: the ``exists`` policy option may not be: ``aerospike.POLICY_EXISTS_CREATE_OR_REPLACE`` nor ``aerospike.POLICY_EXISTS_REPLACE`` + .. Does this still apply? + + :param dict policy: optional :ref:`aerospike_operate_policies`. Note: the ``exists`` policy option may not be: :py:data:`aerospike.POLICY_EXISTS_CREATE_OR_REPLACE` nor :py:data:`aerospike.POLICY_EXISTS_REPLACE` :raises: a subclass of :exc:`~aerospike.exception.AerospikeError`. .. code-block:: python From 2e0c039ad878430caabd06f29d1f27fc9ec16c7a Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 7 May 2026 11:09:38 -0700 Subject: [PATCH 2/9] Just ignore todo for this pr --- aerospike_helpers/operations/bitwise_operations.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/aerospike_helpers/operations/bitwise_operations.py b/aerospike_helpers/operations/bitwise_operations.py index 32d283a273..23b7144c59 100644 --- a/aerospike_helpers/operations/bitwise_operations.py +++ b/aerospike_helpers/operations/bitwise_operations.py @@ -167,11 +167,9 @@ def bit_resize(bin_name: str, byte_size, policy=None, resize_flags: int = 0): bin_name (str): The name of the bin containing the map. byte_size (int): The new size of the bytes. policy (dict): The :ref:`bit_policy ` dictionary. default: None. - # TODO: this is the only method referencing these flags, but should document explicitly that - # the flags can be bitwise OR'd together. resize_flags (int): :ref:`aerospike_bitwise_resize_flag` modifying the resize behavior - (default ``aerospike.BIT_RESIZE_DEFAULT``), such as ``aerospike.BIT_RESIZE_GROW_ONLY | - aerospike.BIT_RESIZE_FROM_FRONT``. + (default :py:data:`aerospike.BIT_RESIZE_DEFAULT`), such as py:data:`aerospike.BIT_RESIZE_GROW_ONLY` | + :py:data:`aerospike.BIT_RESIZE_FROM_FRONT`. Returns: A dictionary usable in operate or operate_ordered. The format of the dictionary From 41971fa166ebe09d691632df4bf49978a19738f3 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 7 May 2026 11:10:48 -0700 Subject: [PATCH 3/9] Cant find cross reference from google so just ignore --- doc/aerospike.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/aerospike.rst b/doc/aerospike.rst index 111d1a3083..3503d3ceb7 100644 --- a/doc/aerospike.rst +++ b/doc/aerospike.rst @@ -140,8 +140,6 @@ Types A type for distinguishing a server-side null from a Python :py:obj:`None`. Replaces the constant ``aerospike.null``. - .. Needs cross reference to server docs - :return: a type representing the server-side type ``as_null``. .. versionadded:: 2.0.1 From d789c99213eaf81a37f2cb13ff365e9545fef921 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 7 May 2026 11:19:19 -0700 Subject: [PATCH 4/9] Replace aerospike constants with cross references to verify that they are correct with sphinx nitpicky mode --- aerospike_helpers/cdt_ctx.py | 4 ++-- .../operations/expression_operations.py | 8 +++++--- aerospike_helpers/operations/list_operations.py | 2 +- doc/client.rst | 14 +++++++------- doc/query.rst | 4 ++-- doc/scan.rst | 4 ++-- 6 files changed, 19 insertions(+), 17 deletions(-) diff --git a/aerospike_helpers/cdt_ctx.py b/aerospike_helpers/cdt_ctx.py index 7aa758fd40..37693e91f8 100644 --- a/aerospike_helpers/cdt_ctx.py +++ b/aerospike_helpers/cdt_ctx.py @@ -231,7 +231,7 @@ def cdt_ctx_list_index_create(index: int, order: int = 0, pad: bool = False) -> Args: index (int): The index to create the list at. order (int): The :ref:`sort order ` to create the List with. - (default: ``aerospike.LIST_UNORDERED``) + (default: :py:data:`aerospike.LIST_UNORDERED`) pad (bool): If index is out of bounds and ``pad`` is :py:obj:`True`, then the list will be created at the index with :py:obj:`None` elements inserted behind it. ``pad`` is only compatible with unordered lists. @@ -309,7 +309,7 @@ def cdt_ctx_map_key_create(key: Any, order: int = 0) -> _cdt_ctx: Args: key (object): The key to create the map at. order (int): The :ref:`sort order ` to create the List with. - (default: ``aerospike.MAP_UNORDERED``) + (default: :py:data:`aerospike.MAP_UNORDERED`) Returns: :class:`~aerospike_helpers.cdt_ctx._cdt_ctx` diff --git a/aerospike_helpers/operations/expression_operations.py b/aerospike_helpers/operations/expression_operations.py index da5ec131ab..fa1719b36f 100644 --- a/aerospike_helpers/operations/expression_operations.py +++ b/aerospike_helpers/operations/expression_operations.py @@ -43,7 +43,8 @@ def expression_read(bin_name: str, expression: resources._BaseExpr, expression_r bin_name (str): The name of the bin to read from. Even if no bin is being read from, the value will be returned with this bin name. expression: A compiled Aerospike expression, see :ref:`aerospike_operation_helpers.expressions`. - expression_read_flags (int): :ref:`aerospike_expression_read_flags` (default ``aerospike.EXP_READ_DEFAULT``) + expression_read_flags (int): :ref:`aerospike_expression_read_flags` + (default :py:data:`aerospike.EXP_READ_DEFAULT`) Returns: A dictionary to be passed to operate or operate_ordered. @@ -84,8 +85,9 @@ def expression_write(bin_name: str, expression: resources._BaseExpr, expression_ Args: bin_name (str): The name of the bin to write to. expression: A compiled Aerospike expression, see :ref:`aerospike_operation_helpers.expressions`. - expression_write_flags (int): :ref:`aerospike_expression_write_flags` such as ``aerospike.EXP_WRITE_UPDATE_ONLY - | aerospike.EXP_WRITE_POLICY_NO_FAIL`` (default ``aerospike.EXP_WRITE_DEFAULT``). + expression_write_flags (int): :ref:`aerospike_expression_write_flags` such as + :py:data:`aerospike.EXP_WRITE_UPDATE_ONLY` | :py:data:`aerospike.EXP_WRITE_POLICY_NO_FAIL` + (default :py:data:`aerospike.EXP_WRITE_DEFAULT`). Returns: A dictionary to be passed to operate or operate_ordered. diff --git a/aerospike_helpers/operations/list_operations.py b/aerospike_helpers/operations/list_operations.py index 238929bd4a..6338394fd7 100755 --- a/aerospike_helpers/operations/list_operations.py +++ b/aerospike_helpers/operations/list_operations.py @@ -1013,7 +1013,7 @@ def list_sort(bin_name: str, sort_flags: int = 0, ctx: Optional[list] = None): Args: bin_name (str): The name of the bin to sort. sort_flags (int): :ref:`aerospike_list_sort_flag` modifying the sorting behavior - (default ``aerospike.DEFAULT_LIST_SORT``). + (default :py:data`aerospike.DEFAULT_LIST_SORT`). ctx (list): An optional list of nested CDT :class:`cdt_ctx ` context operation objects. Returns: diff --git a/doc/client.rst b/doc/client.rst index 7ca4a3009d..4ed579f1c2 100755 --- a/doc/client.rst +++ b/doc/client.rst @@ -668,7 +668,7 @@ User Defined Functions :param dict policy: optional dictionary that takes in both :ref:`aerospike_scan_policies` and :ref:`aerospike_info_policies`. :param dict options: the :ref:`aerospike_scan_options` that will apply to the scan. :rtype: :class:`int` - :return: a job ID that can be used with :meth:`job_info` to check the status of the ``aerospike.JOB_SCAN``. + :return: a job ID that can be used with :meth:`job_info` to check the status of the :py:data:`aerospike.JOB_SCAN`. :raises: a subclass of :exc:`~aerospike.exception.AerospikeError`. .. method:: query_apply(ns, set, predicate, module, function[, args[, policy: dict]]) -> int @@ -685,7 +685,7 @@ User Defined Functions :param list args: the arguments to the UDF. :param dict policy: optional dictionary that takes in both :ref:`aerospike_write_policies` and :ref:`aerospike_info_policies`. :rtype: :class:`int` - :return: a job ID that can be used with :meth:`job_info` to check the status of the ``aerospike.JOB_QUERY``. + :return: a job ID that can be used with :meth:`job_info` to check the status of the :py:data:`aerospike.JOB_QUERY`. :raises: a subclass of :exc:`~aerospike.exception.AerospikeError`. .. method:: job_info(job_id, module[, policy: dict]) -> dict @@ -1804,7 +1804,7 @@ Read Policies * **replica** | One of the :ref:`POLICY_REPLICA` values such as :data:`aerospike.POLICY_REPLICA_MASTER` | - | Default: ``aerospike.POLICY_REPLICA_SEQUENCE`` + | Default: :py:data:`aerospike.POLICY_REPLICA_SEQUENCE` .. _aerospike_operate_policies: @@ -1968,7 +1968,7 @@ Remove Policies * **replica** | One of the :ref:`POLICY_REPLICA` values such as :data:`aerospike.POLICY_REPLICA_MASTER` | - | Default: ``aerospike.POLICY_REPLICA_SEQUENCE`` + | Default: :py:data:`aerospike.POLICY_REPLICA_SEQUENCE` .. _aerospike_batch_policies: @@ -2287,12 +2287,12 @@ List Policies * **write_flags** | Write flags for the operation. - | One of the :ref:`aerospike_list_write_flag` values such as :data:`aerospike.LIST_WRITE_DEFAULT` + | One of the :ref:`aerospike_list_write_flag` values. | | Default: :data:`aerospike.LIST_WRITE_DEFAULT` | | Values should be or'd together: - | ``aerospike.LIST_WRITE_ADD_UNIQUE | aerospike.LIST_WRITE_INSERT_BOUNDED`` + | :py:data:`aerospike.LIST_WRITE_ADD_UNIQUE` | :py:data:`aerospike.LIST_WRITE_INSERT_BOUNDED` * **list_order** | Ordering to maintain for the list. @@ -2328,7 +2328,7 @@ Map Policies | Default: :data:`aerospike.MAP_WRITE_FLAGS_DEFAULT` | | Values should be or'd together: - | ``aerospike.LIST_WRITE_ADD_UNIQUE | aerospike.LIST_WRITE_INSERT_BOUNDED`` + | :data:`aerospike.LIST_WRITE_ADD_UNIQUE` | :data:`aerospike.LIST_WRITE_INSERT_BOUNDED` .. note:: This is only valid for Aerospike Server versions >= 4.3.0. diff --git a/doc/query.rst b/doc/query.rst index cbcbed7e6e..7e8d410d3c 100755 --- a/doc/query.rst +++ b/doc/query.rst @@ -327,7 +327,7 @@ Assume this boilerplate code is run before all examples below: :param dict policy: optional :ref:`aerospike_write_policies`. - :return: a job ID that can be used with :meth:`~aerospike.Client.job_info` to track the status of the ``aerospike.JOB_QUERY`` , as it runs in the background. + :return: a job ID that can be used with :meth:`~aerospike.Client.job_info` to track the status of the :py:data:`aerospike.JOB_QUERY` , as it runs in the background. .. code-block:: python @@ -532,7 +532,7 @@ Policies * **replica** | One of the :ref:`POLICY_REPLICA` values such as :data:`aerospike.POLICY_REPLICA_MASTER` | - | Default: ``aerospike.POLICY_REPLICA_SEQUENCE`` + | Default: :py:data:`aerospike.POLICY_REPLICA_SEQUENCE` .. _aerospike_query_options: diff --git a/doc/scan.rst b/doc/scan.rst index 258172fc31..b6247111a8 100755 --- a/doc/scan.rst +++ b/doc/scan.rst @@ -298,7 +298,7 @@ Methods :param dict policy: optional :ref:`aerospike_write_policies`. - :return: a job ID that can be used with :meth:`~aerospike.Client.job_info` to track the status of the ``aerospike.JOB_SCAN``, as it runs in the background. + :return: a job ID that can be used with :meth:`~aerospike.Client.job_info` to track the status of the :py:data:`aerospike.JOB_SCAN`, as it runs in the background. .. note:: Python client version 3.10.0 implemented scan execute_background. @@ -481,7 +481,7 @@ Policies * **replica** | One of the :ref:`POLICY_REPLICA` values such as :data:`aerospike.POLICY_REPLICA_MASTER` | - | Default: ``aerospike.POLICY_REPLICA_SEQUENCE`` + | Default: :py:data:`aerospike.POLICY_REPLICA_SEQUENCE` * **ttl** (:class:`int`) The default time-to-live (expiration) of the record in seconds. This field will only be used on background scan writes if :py:attr:`aerospike.Scan.ttl` is set to From 97602559cfb9e9b37798051f67bb56290042a067 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 7 May 2026 14:57:26 -0700 Subject: [PATCH 5/9] Fix formatting. Remove TODO comment that is causing formatting error --- aerospike_helpers/operations/expression_operations.py | 4 ++-- doc/client.rst | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/aerospike_helpers/operations/expression_operations.py b/aerospike_helpers/operations/expression_operations.py index fa1719b36f..bdefc04eef 100644 --- a/aerospike_helpers/operations/expression_operations.py +++ b/aerospike_helpers/operations/expression_operations.py @@ -86,8 +86,8 @@ def expression_write(bin_name: str, expression: resources._BaseExpr, expression_ bin_name (str): The name of the bin to write to. expression: A compiled Aerospike expression, see :ref:`aerospike_operation_helpers.expressions`. expression_write_flags (int): :ref:`aerospike_expression_write_flags` such as - :py:data:`aerospike.EXP_WRITE_UPDATE_ONLY` | :py:data:`aerospike.EXP_WRITE_POLICY_NO_FAIL` - (default :py:data:`aerospike.EXP_WRITE_DEFAULT`). + :py:data:`aerospike.EXP_WRITE_UPDATE_ONLY` | :py:data:`aerospike.EXP_WRITE_POLICY_NO_FAIL` + (default :py:data:`aerospike.EXP_WRITE_DEFAULT`). Returns: A dictionary to be passed to operate or operate_ordered. diff --git a/doc/client.rst b/doc/client.rst index 4ed579f1c2..ee9c225b5c 100755 --- a/doc/client.rst +++ b/doc/client.rst @@ -483,8 +483,6 @@ Numeric Operations :param int offset: the value by which to increment the value in *bin*. :type offset: :py:class:`int` or :py:class:`float` :param dict meta: record metadata to be set. See :ref:`metadata_dict`. - .. Does this still apply? - :param dict policy: optional :ref:`aerospike_operate_policies`. Note: the ``exists`` policy option may not be: :py:data:`aerospike.POLICY_EXISTS_CREATE_OR_REPLACE` nor :py:data:`aerospike.POLICY_EXISTS_REPLACE` :raises: a subclass of :exc:`~aerospike.exception.AerospikeError`. From ba84596ff90b481bff762cf2b128d5cdca5f2819 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 7 May 2026 15:06:38 -0700 Subject: [PATCH 6/9] Fix bad syntax. --- aerospike_helpers/operations/list_operations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aerospike_helpers/operations/list_operations.py b/aerospike_helpers/operations/list_operations.py index 6338394fd7..a84ad11708 100755 --- a/aerospike_helpers/operations/list_operations.py +++ b/aerospike_helpers/operations/list_operations.py @@ -1013,7 +1013,7 @@ def list_sort(bin_name: str, sort_flags: int = 0, ctx: Optional[list] = None): Args: bin_name (str): The name of the bin to sort. sort_flags (int): :ref:`aerospike_list_sort_flag` modifying the sorting behavior - (default :py:data`aerospike.DEFAULT_LIST_SORT`). + (default :py:data:`aerospike.DEFAULT_LIST_SORT`). ctx (list): An optional list of nested CDT :class:`cdt_ctx ` context operation objects. Returns: From e99684bf4d1640f2c448f7d4901b08eb9c1897e2 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 7 May 2026 15:13:08 -0700 Subject: [PATCH 7/9] Fix invalid cross ref --- aerospike_helpers/operations/list_operations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aerospike_helpers/operations/list_operations.py b/aerospike_helpers/operations/list_operations.py index a84ad11708..9ba0d1f175 100755 --- a/aerospike_helpers/operations/list_operations.py +++ b/aerospike_helpers/operations/list_operations.py @@ -1013,7 +1013,7 @@ def list_sort(bin_name: str, sort_flags: int = 0, ctx: Optional[list] = None): Args: bin_name (str): The name of the bin to sort. sort_flags (int): :ref:`aerospike_list_sort_flag` modifying the sorting behavior - (default :py:data:`aerospike.DEFAULT_LIST_SORT`). + (default :py:data:`aerospike.LIST_SORT_DEFAULT`). ctx (list): An optional list of nested CDT :class:`cdt_ctx ` context operation objects. Returns: From bbeeb8e297f0c5517df705a376f1fd4b3fe85122 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 7 May 2026 16:59:56 -0700 Subject: [PATCH 8/9] Remove this to try fixing docs build error --- doc/aerospike.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/aerospike.rst b/doc/aerospike.rst index 3503d3ceb7..4ed1b8c5ad 100644 --- a/doc/aerospike.rst +++ b/doc/aerospike.rst @@ -1250,11 +1250,11 @@ List Sort Flags Flags used by list sort. -.. data:: aerospike.LIST_SORT_DEFAULT +.. data:: LIST_SORT_DEFAULT Default. Preserve duplicates when sorting the list. -.. data:: aerospike.LIST_SORT_DROP_DUPLICATES +.. data:: LIST_SORT_DROP_DUPLICATES Drop duplicate values when sorting the list. From bd60059b68763318166a5889e1c105d1393aa4d1 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 8 May 2026 08:43:37 -0700 Subject: [PATCH 9/9] Fix invalid syntax --- aerospike_helpers/operations/bitwise_operations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aerospike_helpers/operations/bitwise_operations.py b/aerospike_helpers/operations/bitwise_operations.py index 23b7144c59..bd18a9cded 100644 --- a/aerospike_helpers/operations/bitwise_operations.py +++ b/aerospike_helpers/operations/bitwise_operations.py @@ -168,7 +168,7 @@ def bit_resize(bin_name: str, byte_size, policy=None, resize_flags: int = 0): byte_size (int): The new size of the bytes. policy (dict): The :ref:`bit_policy ` dictionary. default: None. resize_flags (int): :ref:`aerospike_bitwise_resize_flag` modifying the resize behavior - (default :py:data:`aerospike.BIT_RESIZE_DEFAULT`), such as py:data:`aerospike.BIT_RESIZE_GROW_ONLY` | + (default :py:data:`aerospike.BIT_RESIZE_DEFAULT`), such as :py:data:`aerospike.BIT_RESIZE_GROW_ONLY` | :py:data:`aerospike.BIT_RESIZE_FROM_FRONT`. Returns: