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/bitwise_operations.py b/aerospike_helpers/operations/bitwise_operations.py index f0677bbe28..bd18a9cded 100644 --- a/aerospike_helpers/operations/bitwise_operations.py +++ b/aerospike_helpers/operations/bitwise_operations.py @@ -168,8 +168,8 @@ 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 ``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 diff --git a/aerospike_helpers/operations/expression_operations.py b/aerospike_helpers/operations/expression_operations.py index da5ec131ab..bdefc04eef 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..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 ``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: 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..4ed1b8c5ad 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 @@ -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. diff --git a/doc/client.rst b/doc/client.rst index 329ab109b7..ee9c225b5c 100755 --- a/doc/client.rst +++ b/doc/client.rst @@ -483,7 +483,7 @@ 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`` + :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 @@ -666,7 +666,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 @@ -683,7 +683,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 @@ -1802,7 +1802,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: @@ -1966,7 +1966,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: @@ -2285,12 +2285,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. @@ -2326,7 +2326,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