Skip to content

Commit

Permalink
Add changelog for v3.0.0-rc.1
Browse files Browse the repository at this point in the history
  • Loading branch information
saumehta9 committed Jun 22, 2020
1 parent 4c9df3c commit 3465e12
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 12 deletions.
35 changes: 33 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
### Release 2.0.2 (May 7, 2020)
* Added `Getting Started` and `Cookbook` to public api docs.
### [Release 3.0.0-rc.1](https://github.com/awslabs/amazon-qldb-driver-python/releases/tag/v3.0.0-rc.1) (June 22, 2020)
Note this version is a release candidate and may not be production ready.

#### Breaking changes:

* [(#23)](https://github.com/awslabs/amazon-qldb-driver-python/issues/23) Moved Session pooling functionality to
`QldbDriver` and removed `PooledQldbDriver`.
* [(#28)](https://github.com/awslabs/amazon-qldb-driver-python/issues/28) Removed interfaces which allow developers to
get a session from the pool and execute transaction.
* [(#29)](https://github.com/awslabs/amazon-qldb-driver-python/issues/29) Renamed `QldbDriver` property `pool_limit` to
`max_concurrent_transactions`.
* [(#30)](https://github.com/awslabs/amazon-qldb-driver-python/issues/30) Removed `QldbDriver` property `pool_timeout`.
* [(#31)](https://github.com/awslabs/amazon-qldb-driver-python/issues/31) Moved method `list_tables` to the driver
instance
* [(#27)](https://github.com/awslabs/amazon-qldb-driver-python/issues/27) Removed `retry_indicator`
from `QldbDriver.execute_lambda`.
* [(#27)](https://github.com/awslabs/amazon-qldb-driver-python/issues/27) Moved `retry_limit` from `QldbDriver` to
`RetryConfig`.
[(#34)](https://github.com/awslabs/amazon-qldb-driver-python/issues/34) Removed `QldbDriver.execute_statement`.

#### New features:

* [(#27)](https://github.com/awslabs/amazon-qldb-driver-python/issues/27) Added support for defining custom retry
backoffs.

#### Announcements

* Dropping support for Python v3.4 and v3.5. Going forward the minimum Python version required will be v3.6 for Pyqldb 3.x
series.


### Release 2.0.2 (May 4, 2020)
* Added `Getting Started` and `Cookbook` to public API docs.

### Release 2.0.1 (March 18, 2020)

Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This is the Python driver for [Amazon Quantum Ledger Database (QLDB)](https://aws.amazon.com/qldb/), which allows Python developers
to write software that makes use of AmazonQLDB.

[![Latest Version](https://img.shields.io/pypi/v/pyqldb.svg)](https://pypi.python.org/pypi/pyqldb)
[![Documentation Status](https://readthedocs.org/projects/amazon-qldb-driver-python/badge/?version=latest)](https://amazon-qldb-driver-python.readthedocs.io/en/latest/?badge=latest)

For our tutorial, see [Python and Amazon QLDB](https://docs.aws.amazon.com/qldb/latest/developerguide/getting-started.python.html).
Expand All @@ -13,9 +14,13 @@ For our tutorial, see [Python and Amazon QLDB](https://docs.aws.amazon.com/qldb/

See [Accessing Amazon QLDB](https://docs.aws.amazon.com/qldb/latest/developerguide/accessing.html) for information on connecting to AWS.

### Python 3.4 or later
### Required Python versions

The driver requires Python 3.4 or later. Please see the link below for more detail to install Python:
Pyqldb 2.x requires Python 3.4 or later.

Pyqldb 3.x requires Python 3.6 or later.

Please see the link below for more detail to install Python:

* [Python Installation](https://www.python.org/downloads/)

Expand All @@ -39,8 +44,8 @@ for table in qldb_driver.list_tables():

### See Also

1. [Getting Started with Amazon QLDB Python Driver](https://amazon-qldb-driver-python.readthedocs.io/en/v2.0.2/guide/getting_started.html) A guide that gets you started with executing transactions with the QLDB Python driver.
2. [QLDB Python Driver Cookbook](https://amazon-qldb-driver-python.readthedocs.io/en/v2.0.2/guide/cookbook.html) The cookbook provides code samples for some simple QLDB Python driver use cases.
1. [Getting Started with Amazon QLDB Python Driver](https://amazon-qldb-driver-python.readthedocs.io/en/stable/guide/getting_started.html) A guide that gets you started with executing transactions with the QLDB Python driver.
2. [QLDB Python Driver Cookbook](https://amazon-qldb-driver-python.readthedocs.io/en/stable/guide/cookbook.html) The cookbook provides code samples for some simple QLDB Python driver use cases.
3. [Amazon QLDB Python Driver Tutorial](https://docs.aws.amazon.com/qldb/latest/developerguide/getting-started.python.tutorial.html): In this tutorial, you use the QLDB Driver for Python to create an Amazon QLDB ledger and populate it with tables and sample data.
4. [Amazon QLDB Python Driver Samples](https://github.com/aws-samples/amazon-qldb-dmv-sample-python): A DMV based example application which demonstrates how to use QLDB with the QLDB Driver for Python.
5. QLDB Python driver accepts and returns [Amazon ION](http://amzn.github.io/ion-docs/) Documents. Amazon Ion is a richly-typed, self-describing, hierarchical data serialization format offering interchangeable binary and text representations. For more information read the [ION docs](https://readthedocs.org/projects/ion-python/).
Expand Down Expand Up @@ -69,7 +74,7 @@ $ pip install -e .
You can run the unit tests with this command:

```
$ pytest --cov-report term-missing --cov=pyqldb
$ pytest --cov-report term-missing --cov=pyqldb tests/unit
```

You can run the integration tests with this command:
Expand Down
51 changes: 49 additions & 2 deletions docs/source/guide/cookbook.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Creating ION types

.. code-block:: python
ion_text = '{GovId: 'TOYENC486FH', FirstName: "Brent"}'
ion_text = '{GovId: "TOYENC486FH", FirstName: "Brent"}'
ion_obj = simpleion.loads(ion_text)
print(ion_obj['GovId']) #prints TOYENC486FH
Expand Down Expand Up @@ -406,4 +406,51 @@ If a competing transaction concurrently passes the assertion, only one of the tr
.. Note::
In the above example, it is recommended to have **index** on the field `GovId` for performance reasons.
A missing index on `GovId` may result in latent queries and higher number of OCC Exceptions.
A missing index on `GovId` may result in latent queries and higher number of OCC Exceptions.

Implementing Custom Retry/Backoff
---------------------------------

The Driver supports specifying custom Retries and Backoffs

.. code-block:: python
from pyqldb.config.retry_config import RetryConfig
from pyqldb.driver.qldb_driver import QldbDriver
# Configuring Retry limit to 2
retry_config = RetryConfig(retry_limit=2)
qldb_driver = QldbDriver("test-ledger", retry_config=retry_config)
# Configuring a custom back off which increases delay by 1s for each attempt.
def custom_backoff(retry_attempt, error, transaction_id):
return 1000 * retry_attempt
retry_config_custom_backoff = RetryConfig(retry_limit=2, custom_backoff=custom_backoff)
qldb_driver = QldbDriver("test-ledger", retry_config=retry_config_custom_backoff)
A custom Retry/Backoff config can also be specified for a particular lambda execution.
Note: Passing a config to :py:meth:`pyqldb.driver.qldb_driver.QldbDriver.execute_lambda` will override
the config specified for `QldbDriver`.

.. code-block:: python
from pyqldb.config.retry_config import RetryConfig
from pyqldb.driver.qldb_driver import QldbDriver
# Configuring Retry limit to 2
retry_config_1 = RetryConfig(retry_limit=4)
qldb_driver = QldbDriver("test-ledger", retry_config=retry_config_1)
# Configuring a custom back off which increases delay by 1s for each attempt.
def custom_backoff(retry_attempt, error, transaction_id):
return 1000 * retry_attempt
retry_config_2 = RetryConfig(retry_limit=2, custom_backoff=custom_backoff)
# The config `retry_config_1` will be overriden by `retry_config_2`
qldb_driver.execute_lambda(lambda txn: txn.execute_statement("CREATE TABLE Person"), retry_config_2)
4 changes: 2 additions & 2 deletions docs/source/reference/config/retry_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ Usage
def custom_backoff(retry_attempt, error, transaction_id):
return 1000 * retry_attempt
retry_config = RetryConfig(retry_limit=2, custom_backoff=custom_backoff)
qldb_driver = QldbDriver("test-ledger", retry_config=retry_config)
retry_config_custom_backoff = RetryConfig(retry_limit=2, custom_backoff=custom_backoff)
qldb_driver = QldbDriver("test-ledger", retry_config=retry_config_custom_backoff)
10 changes: 9 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,13 @@ def get_version():
author='Amazon Web Services',
packages=setuptools.find_packages(),
install_requires=requires,
license="Apache License 2.0"
license="Apache License 2.0",
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8"
]
)

0 comments on commit 3465e12

Please sign in to comment.