From d701bf574c55a802ec4bb8ecddc29698f189c7f2 Mon Sep 17 00:00:00 2001 From: dylan Date: Wed, 17 Feb 2021 17:18:50 -0800 Subject: [PATCH] add expression policy docs, add server 4.9 requirement warnings --- README.rst | 5 +++- aerospike_helpers/expressions/base.py | 2 +- doc/client.rst | 36 ++++++++++++++++----------- doc/query.rst | 6 +++++ doc/scan.rst | 10 ++++---- 5 files changed, 38 insertions(+), 21 deletions(-) diff --git a/README.rst b/README.rst index 3bd37136d..7b3bf17f0 100644 --- a/README.rst +++ b/README.rst @@ -11,9 +11,12 @@ Aerospike Python Client Dependencies ------------ -The Python client for Aerospike works with Python 2.7, 3.4, 3.5, 3.6, 3.7, 3.8 running on +The Python client for Aerospike works with Python 3.5, 3.6, 3.7, 3.8 running on **64-bit** OS X 10.9+ and Linux. +NOTE: Python client 5.0.0 and up MUST be used with Aerospike server 4.9 or later. +If you see the error "-10, ‘Failed to connect’", please make sure you are using server 4.9 or later. + NOTE: The following dependencies only apply to installations that build from source on linux, or OS X installations. For client>=3.8.0 and pip>=19.0 on linux platforms, can skip to "Install" section. diff --git a/aerospike_helpers/expressions/base.py b/aerospike_helpers/expressions/base.py index 0d5d3fd3a..8e8f4d2ed 100644 --- a/aerospike_helpers/expressions/base.py +++ b/aerospike_helpers/expressions/base.py @@ -18,7 +18,7 @@ Example:: - import aerospike_helpers.expressions as exp + import aerospike_helpers.expressions.base as exp # See if integer bin "bin_name" contains a value equal to 10. expr = exp.Eq(exp.IntBin("bin_name"), 10).compile() ''' diff --git a/doc/client.rst b/doc/client.rst index 7d569a531..c2ff0df4d 100755 --- a/doc/client.rst +++ b/doc/client.rst @@ -88,6 +88,10 @@ Connection :raises: :exc:`~aerospike.exception.ClientError`, for example when a connection cannot be \ established to a seed node (any single node in the cluster from which the client \ learns of the other nodes). + + .. note:: + Python client 5.0.0 and up will fail to connect to Aerospike server 4.8.x or older. + If you see the error "-10, ‘Failed to connect’", please make sure you are using server 4.9 or later. .. seealso:: `Security features article `_. @@ -2358,7 +2362,7 @@ Info Operations :param str data_center: The data center to apply the filter to. :param str namespace: The namespace to apply the filter to. - :param expression expression_filter: The filter to set. See :py:mod:`aerospike_helpers.expressions`. + :param expression expression_filter: The filter to set. See expressions at :py:mod:`aerospike_helpers`. :param dict policy: optional :ref:`aerospike_info_policies`. :raises: a subclass of :exc:`~aerospike.exception.AerospikeError`. @@ -2817,9 +2821,9 @@ Write Policies | | Default: ``False`` - .. note:: Requires Enterprise server version >= 3.10 - * **predexp** :class:`list` - | A list of :mod:`aerospike.predexp` used as a predicate filter for record, bin, batch, and record UDF operations. + .. note:: Requires Enterprise server version >= 5.0 + * **expressions** :class:`list` + | Compiled aerospike expressions :mod:`aerospike_helpers` used for filtering records within a transaction. | | Default: None @@ -2896,8 +2900,10 @@ Read Policies | One of the :ref:`POLICY_REPLICA` values such as :data:`aerospike.POLICY_REPLICA_MASTER` | | Default: ``aerospike.POLICY_REPLICA_SEQUENCE`` - * **predexp** :class:`list` - | A list of :mod:`aerospike.predexp` used as a predicate filter for record, bin, batch, and record UDF operations. + + .. note:: Requires Enterprise server version >= 5.0 + * **expressions** :class:`list` + | Compiled aerospike expressions :mod:`aerospike_helpers` used for filtering records within a transaction. | | Default: None @@ -2990,9 +2996,9 @@ Operate Policies | | Default: ``False`` - .. note:: Requires Enterprise server version >= 3.10 - * **predexp** :class:`list` - | A list of :mod:`aerospike.predexp` used as a predicate filter for record, bin, batch, and record UDF operations. + .. note:: Requires Enterprise server version >= 5.0 + * **expressions** :class:`list` + | Compiled aerospike expressions :mod:`aerospike_helpers` used for filtering records within a transaction. | | Default: None @@ -3067,9 +3073,9 @@ Apply Policies | | Default: ``False`` - .. note:: Requires Enterprise server version >= 3.10 - * **predexp** :class:`list` - | A list of :mod:`aerospike.predexp` used as a predicate filter for record, bin, batch, and record UDF operations. + .. note:: Requires Enterprise server version >= 5.0 + * **expressions** :class:`list` + | Compiled aerospike expressions :mod:`aerospike_helpers` used for filtering records within a transaction. | | Default: None @@ -3146,8 +3152,10 @@ Remove Policies | One of the :ref:`POLICY_REPLICA` values such as :data:`aerospike.POLICY_REPLICA_MASTER` | | Default: ``aerospike.POLICY_REPLICA_SEQUENCE`` - * **predexp** :class:`list` - | A list of :mod:`aerospike.predexp` used as a predicate filter for record, bin, batch, and record UDF operations. + + .. note:: Requires Enterprise server version >= 5.0 + * **expressions** :class:`list` + | Compiled aerospike expressions :mod:`aerospike_helpers` used for filtering records within a transaction. | | Default: None diff --git a/doc/query.rst b/doc/query.rst index 894ca2c70..f2126c0ab 100755 --- a/doc/query.rst +++ b/doc/query.rst @@ -559,6 +559,12 @@ Query Policies | | Default ``False`` + .. note:: Requires Enterprise server version >= 5.0 + * **expressions** :class:`list` + | Compiled aerospike expressions :mod:`aerospike_helpers` used for filtering records within a transaction. + | + | Default: None + .. _aerospike_query_options: Query Options diff --git a/doc/scan.rst b/doc/scan.rst index 5c37b5643..d39cb407b 100755 --- a/doc/scan.rst +++ b/doc/scan.rst @@ -413,12 +413,12 @@ Scan Policies | Requires server version >= 4.7.0. | | Default: ``0`` (no limit). - * **predexp** :class:`list` - | List of :mod:`~aerospike.predexp` used to filter scan results. - | Can be used with the :func:`~aerospike.Scan.results`, :func:`~aerospike.Scan.foreach`, and :func:`~aerospike.Scan.execute_background` methods. - | Requires server version >= 4.7.0 and Client version >= 3.10.0. + + .. note:: Requires Enterprise server version >= 5.0 + * **expressions** :class:`list` + | Compiled aerospike expressions :mod:`aerospike_helpers` used for filtering records within a transaction. | - | Default: ``[]`` (no filter). + | Default: ``None`` .. _aerospike_scan_options: