Skip to content

Commit

Permalink
Fix docs syntax errors (#771)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikonst committed Apr 24, 2020
1 parent 99080e4 commit e718d76
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 23 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -29,6 +29,7 @@ before_script:
script:
- pytest --cov-report term-missing --cov=pynamodb tests
- if [[ "$TRAVIS_PYTHON_VERSION" == "3.7" ]]; then mypy .; fi
- sphinx-build -W docs /tmp/docs-build

after_success:
- coveralls
Expand Down
5 changes: 0 additions & 5 deletions docs/api.rst
Expand Up @@ -39,8 +39,3 @@ Exceptions
.. autoexception:: pynamodb.exceptions.TableDoesNotExist
.. autoexception:: pynamodb.exceptions.DoesNotExist

Migration API
-------------

.. automodule:: pynamodb.migration
:members:
2 changes: 1 addition & 1 deletion docs/conf.py
Expand Up @@ -138,7 +138,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
#html_static_path = ['_static']

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down
2 changes: 2 additions & 0 deletions docs/index.rst
Expand Up @@ -34,6 +34,8 @@ Topics
conditional
attributes
transaction
optimistic_locking
rate_limited_operations
local
backup_restore
signals
Expand Down
4 changes: 2 additions & 2 deletions docs/local.rst
Expand Up @@ -34,7 +34,7 @@ that your server is listening on.
Running dynalite
^^^^^^^^^^^^^^^^

Make sure you have the Node Package Manager installed, instructions `here <https://www.npmjs.org/doc/README.html>`_.
Make sure you have the Node Package Manager installed (see `npm instructions <https://www.npmjs.org/doc/README.html>`_).

Install dynalite::

Expand All @@ -55,7 +55,7 @@ store your data. You can use DynamoDB local with PynamoDB for testing, debugging
For more information, you can read `Amazon's Announcement <http://aws.amazon.com/about-aws/whats-new/2013/09/12/amazon-dynamodb-local/>`_ and
`Jeff Barr's blog post <http://aws.typepad.com/aws/2013/09/dynamodb-local-for-desktop-development.html>`_ about it.

* Download the latest version of DynamoDB local `here <http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest>`_.
* Download the `latest version of DynamoDB local <http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest>`_.
* Unpack the contents of the archive into a directory of your choice.

DynamoDB local requires the `Java Runtime Environment <http://java.com/en/>`_ version 7. Make sure the JRE is installed before continuing.
Expand Down
2 changes: 1 addition & 1 deletion docs/rate_limited_operations.rst
@@ -1,5 +1,5 @@
Rate-Limited Operation
================
======================

`Scan`, `Query` and `Count` operations can be rate-limited based on the consumed capacities returned from DynamoDB.
Simply specify the `rate_limit` argument when calling these methods. Rate limited batch writes are not currently supported,
Expand Down
2 changes: 1 addition & 1 deletion docs/release_notes.rst
Expand Up @@ -453,7 +453,7 @@ re-serialize any data that was written with v1.5.4 and below.
Temporary feature in this release:

* Model.fix_unicode_set_attributes() migration helper
# Model.needs_unicode_set_fix() migration helper
* Model.needs_unicode_set_fix() migration helper


v2.1.6
Expand Down
2 changes: 1 addition & 1 deletion docs/signals.rst
Expand Up @@ -24,7 +24,7 @@ The callback must taking the following arguments:
Arguments Description
================ ===========
*sender* The object that fired that method.
*operation_name* The string name of the `DynamoDB action`_
*operation_name* The string name of the DynamoDB action
*table_name* The name of the table the operation is called upon.
*req_uuid* A unique identifer so subscribers can correlate the before and after events.
================ ===========
Expand Down
25 changes: 15 additions & 10 deletions docs/transaction.rst
Expand Up @@ -30,7 +30,7 @@ Transact Writes

A :py:class:`TransactWrite <pynamodb.transactions.TransactWrite>` can be initialized with the following parameters:

* ``connection`` (required) - the :py:class:`Connection <pynamodb.connection.base.Connection>` used to make the request (see :ref:`low_level`)
* ``connection`` (required) - the :py:class:`Connection <pynamodb.connection.base.Connection>` used to make the request (see :ref:`low-level`)
* ``client_request_token`` - an idempotency key for the request (see `ClientRequestToken <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactWriteItems.html#DDB-TransactWriteItems-request-ClientRequestToken>`_ in the DynamoDB API reference)
* ``return_consumed_capacity`` - determines the level of detail about provisioned throughput consumption that is returned in the response (see `ReturnConsumedCapacity <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactWriteItems.html#DDB-TransactWriteItems-request-ReturnConsumedCapacity>`_ in the DynamoDB API reference)
* ``return_item_collection_metrics`` - determines whether item collection metrics are returned (see `ReturnItemCollectionMetrics <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactWriteItems.html#DDB-TransactWriteItems-request-ReturnItemCollectionMetrics>`_ in the DynamoDB API reference)
Expand Down Expand Up @@ -118,12 +118,12 @@ Condition Check

The ``ConditionCheck`` operation is used on a :py:class:`TransactWrite <pynamodb.transactions.TransactWrite>` to check if the current state of a record you
aren't modifying within the overall transaction fits some criteria that, if it fails, would cause the entire
transaction to fail. The ``condition`` argument is of type :ref:`conditional`.
transaction to fail. The ``condition`` argument is of type :ref:`conditional_operations`.

* ``model_cls`` (required)
* ``hash_key`` (required)
* ``range_key`` (optional)
* ``condition`` (required) - of type :py:class:`Condition <pynamodb.expressions.condition.Condition>` (see :ref:`conditional`)
* ``condition`` (required) - of type :py:class:`Condition <pynamodb.expressions.condition.Condition>` (see :ref:`conditional_operations`)

.. code-block:: python
Expand All @@ -137,7 +137,7 @@ Delete
The ``Delete`` operation functions similarly to ``Model.delete``.

* ``model`` (required)
* ``condition`` (optional) - of type :py:class:`Condition <pynamodb.expressions.condition.Condition>` (see :ref:`conditional`)
* ``condition`` (optional) - of type :py:class:`Condition <pynamodb.expressions.condition.Condition>` (see :ref:`conditional_operations`)

.. code-block:: python
Expand All @@ -154,8 +154,8 @@ Save
The ``Put`` operation functions similarly to ``Model.save``.

* ``model`` (required)
* ``condition`` (optional) - of type :py:class:`Condition <pynamodb.expressions.condition.Condition>` (see :ref:`conditional`)
* ``return_values`` (optional) - the values that should be returned if the condition fails ((see `ReturnValuesOnConditionCheckFailure <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Put.html#DDB-Type-Put-ReturnValuesOnConditionCheckFailure>`_ in the DynamoDB API reference)
* ``condition`` (optional) - of type :py:class:`Condition <pynamodb.expressions.condition.Condition>` (see :ref:`conditional_operations`)
* ``return_values`` (optional) - the values that should be returned if the condition fails ((see `Put ReturnValuesOnConditionCheckFailure`_ in the DynamoDB API reference)

.. code-block:: python
Expand All @@ -172,8 +172,8 @@ The ``Update`` operation functions similarly to ``Model.update``.

* ``model`` (required)
* ``actions`` (required) - a list of type :py:class:`Action <pynamodb.expressions.update.Action>` (see :ref:`updates`)
* ``condition`` (optional) - of type :py:class:`Condition <pynamodb.expressions.condition.Condition>` (see :ref:`conditional`)
* ``return_values`` (optional) - the values that should be returned if the condition fails (see `ReturnValuesOnConditionCheckFailure <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Update.html#DDB-Type-Update-ReturnValuesOnConditionCheckFailure>`_ in the DynamoDB API reference)
* ``condition`` (optional) - of type :py:class:`Condition <pynamodb.expressions.condition.Condition>` (see :ref:`conditional_operations`)
* ``return_values`` (optional) - the values that should be returned if the condition fails (see `Update ReturnValuesOnConditionCheckFailure`_ in the DynamoDB API reference)


.. code-block:: python
Expand Down Expand Up @@ -215,6 +215,11 @@ Error Types

You can expect some new error types with transactions, such as:

* :py:exc:`TransactWriteError <pynamodb.exceptions.TransactWriteError>` - thrown when a :py:class:`TransactWrite <pynamodb.transactions.TransactWrite>` request returns a bad response (see the `Errors <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactWriteItems.html#API_TransactWriteItems_Errors>`_ section in the DynamoDB API reference).
* :py:exc:`TransactGetError <pynamodb.exceptions.TransactGetError>` - thrown when a :py:class:`TransactGet <pynamodb.transactions.TransactGet>` request returns a bad response (see the `Errors <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactGetItems.html#API_TransactGetItems_Errors>`_ section in the DynamoDB API reference).
* :py:exc:`TransactWriteError <pynamodb.exceptions.TransactWriteError>` - thrown when a :py:class:`TransactWrite <pynamodb.transactions.TransactWrite>` request returns a bad response (see the `TransactWriteItems Errors`_ section in the DynamoDB API reference).
* :py:exc:`TransactGetError <pynamodb.exceptions.TransactGetError>` - thrown when a :py:class:`TransactGet <pynamodb.transactions.TransactGet>` request returns a bad response (see the `TransactGetItems Errors`_ section in the DynamoDB API reference).
* :py:exc:`InvalidStateError <pynamodb.exceptions.InvalidStateError>` - thrown when an attempt is made to access data on a :py:class:`_ModelFuture <pynamodb.models._ModelFuture>` before the `TransactGet` request is completed.

.. _Update ReturnValuesOnConditionCheckFailure: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Update.html#DDB-Type-Update-ReturnValuesOnConditionCheckFailure>
.. _Put ReturnValuesOnConditionCheckFailure: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Put.html#DDB-Type-Put-ReturnValuesOnConditionCheckFailure
.. _TransactWriteItems Errors: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactWriteItems.html#API_TransactWriteItems_Errors
.. _TransactGetItems Errors: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactGetItems.html#API_TransactGetItems_Errors
4 changes: 2 additions & 2 deletions pynamodb/models.py
Expand Up @@ -476,8 +476,8 @@ def get(cls,
:param hash_key: The hash key of the desired item
:param range_key: The range key of the desired item, only used when appropriate.
:param consistent_read
:param attributes_to_get
:param consistent_read:
:param attributes_to_get:
:raises ModelInstance.DoesNotExist: if the object to be updated does not exist
"""
hash_key, range_key = cls._serialize_keys(hash_key, range_key)
Expand Down
2 changes: 2 additions & 0 deletions requirements-dev.txt
Expand Up @@ -9,3 +9,5 @@ python-dateutil==2.8.0
coveralls
mypy==0.761;python_version>="3.7"
pytest-cov
sphinx
sphinx-rtd-theme

0 comments on commit e718d76

Please sign in to comment.