Skip to content

Releases: awslabs/amazon-qldb-driver-python

Release Pyqldb v3.2.4

23 Apr 19:07
407b738
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v3.2.3...v3.2.4

Release Pyqldb v3.2.3

25 May 00:46
Compare
Choose a tag to compare

Release 3.2.3

This release pins the Amazon Ion library to a compatible version.

Bug Fixes:

  • Pinned the version of amazon.ion to 0.9.3, as later versions are incompatible with this driver.

Release Pyqldb v3.2.2

28 Oct 20:44
3e6d1c0
Compare
Choose a tag to compare

Release 3.2.2

This release is to update ionhash Python package from 1.2.0 to 1.2.1.

🎉 Enhancements

Release Pyqldb v3.2.1

30 Aug 22:19
079da01
Compare
Choose a tag to compare

Release 3.2.1

This release is to update ionhash Python package from 1.1.0 to 1.2.0.

Bug Fixes:

  • Fixed bug which leads to attributeError when using plain python strings in QLDB driver.

Release Pyqldb v3.2.0

14 May 19:28
d6eb3c8
Compare
Choose a tag to compare

Release 3.2.0

This release is focused on improving the retry logic, optimizing it and handling more possible failures.

🎉 Enhancements

  • Improved retry logic
    • Failures when starting a new session are now retried.
    • Dead sessions are immediately discarded, reducing latency when using the driver.
    • boto3 and botocore bumped to 1.17.5 and 1.20.5 respectively, which gives visibility to CapacityExceededException.

Bug Fixes:

  • Fixed attribute error when retrieving the retry_limit property on QldbDriver.

Release Pyqldb v3.1.0

03 Feb 20:43
a6aee3a
Compare
Choose a tag to compare

Release 3.1.0

🎉 Enhancements

  • Added get_consumed_ios and get_timing_information methods in BufferedCursor and StreamCursor classes to provide server-side statement execution statistics.

    • get_consumed_ios returns a dictionary containing the number of read IO requests for a statement execution.
    • get_timing_information returns a dictionary containing the server side processing time in milliseconds for a statement execution.
    • get_consumed_ios and get_timing_information methods in the StreamCursor class are stateful, meaning the statistics returned by them reflect the state at the time of method execution.
  • Add transaction_id property in Executor to provide the Transaction ID if needed.

  • The Config parameter of QldbDriver now appends the user_agent_extra value instead of overwriting it.

Release Pyqldb v3.0.0

21 Aug 02:09
Compare
Choose a tag to compare

The Amazon QLDB team is pleased to announce the release v3.0.0 of the Amazon QLDB Driver for Python.
This is a public and generally available(GA) release of the driver, and this version can be used in production applications.

Migrating from v3.0.0rc1 and v3.0.0rc2 to v3.0.0

If you have been using v3.0.0rc.1 or v3.0.0rc.2 , you just need to upgrade the version of amazon-qldb-driver-python being used. There are no code changes required.

Migrating from v2.x to v3.0.0

For v2.0.0, v2.0.1, v2.0.2: Please make sure to follow recommended code changes in v3.0.0rc1 release notes. Also, the minimum Python version has been changed to Python 3.6 or later.

Migrating from v1.x to v3.0.0

Please make sure to follow code change recommendations based on release notes in v2.0.0 and v3.0.0rc1.
Also, minimum required Python version has been bumped to Python 3.6 or later.

Release Pyqldb v3.0.0rc2

06 Aug 20:53
Compare
Choose a tag to compare
Pre-release

Release 3.0.0rc2

Note: This version is a release candidate and may not be production ready.

Bug Fixes:

  • Fixed bug which leads to infinite number of retries when a transaction expires.
  • Fixed bug which causes transaction to remain open when an unknown exception is thrown inside execute_lambda.
  • Added a limit to the number of times the driver will try to get(from pool)/create a session.

Release v3.0.0rc1

22 Jun 21:57
Compare
Choose a tag to compare
Release v3.0.0rc1 Pre-release
Pre-release

Release 3.0.0-rc.1

The release includes enhancements over the previous releases of Pyqldb in terms of developer experience. Also it includes improvements in the session pooling approach.
Note: This version is a release candidate and may not be production ready.

Breaking changes:

#23 Session pooling functionality moved to QldbDriver

In the preview version, we provided 2 versions of the driver class, the standard QldbDriver and a PooledQldbDriver. As the name suggests, the PooledQldbDriver maintained a pool of sessions which allowed you to reuse the underlying connections.
Over a period of time, we realized that customers would just want to use the pooling mechanism for its benefits instead of the standard driver. Therefore, we removed the PooledQldbDriver and moved the pooling functionality to QldbDriver.

To migrate, all you have to do is use the QldbDriver instead of PooledQldbDriver.

Before:

from pyqldb.driver.pooled_qldb_driver import PooledQldbDriver

qldb_driver = PooledQldbDriver(ledger_name='vehicle-registration')

Now:

from pyqldb.driver.qldb_driver import QldbDriver

qldb_driver = QldbDriver(ledger_name='vehicle-registration')
#28 Removed interfaces which allowed to grab a session from the pool and execute transaction.

The driver provided too many options to execute a transaction. This made it difficult to use and to decide how and when to use one option over the other. With this release have removed get_session() method on the driver interface. This means developers will no longer be able to get a session from the pool and execute transactions. Instead developers should use the execute_lambda on the driver interface which does all the work of getting a session, executing transactions implicitly.

To migrate your code, all you have to do is to call the execute_lambda of an instance of QldbDriver.

Before


with qldb_driver.get_session() as session:

  transaction = session.start_transaction()
  transaction.execute_statment("CREATE TABLE Person")
  transaction.commit()
  
expect Exception as e:
.....

Now

def create_table(transaction_executor):
    # Transaction started implicitly, no need to explicitly start transaction
    
	 transaction_executor.execute_statement("CREATE TABLE Person")

    # Transaction committed implicitly on return,
    # no need to explicitly commit transaction


qldb_driver.execute_lambda(lambda executor: create_table(executor))

Also the method execute_statement has been removed from QldbDriver.

Now, to execute a statement, all you have to do is use the QldbDriver.execute_lambda method that takes a lambda function. Check the Cookbook for more examples.

#31 Helper method list_tables now available on the driver instance

The Session interface exposed a helper method called list_tables which listed all the tables present in your ledger. With this release, this method has now been moved to QldbDriver.

If you were using it before, then all you have to do is call it from an QldbDriver instance instead of QldbSession.

Before

session = driver.get_session();
tables = session.list_tables();

Now

tables = driver.list_tables();

#34 Removed QldbDriver.execute_statement.

If you were using it before, then all you have to do is migrate to QldbDriver.execute_lambda.

Before

qldb_driver.execute_statement("CREATE TABLE Person")

Now

qldb_driver.execute_lambda(lambda txn: txn.execute_statement("CREATE TABLE Person"))

Note: The execute_statement method on Executor will remains untouched.

Changes in QldbDriver Properties
  • #29 QldbDriver property pool_limit has been renamed to max_concurrent_transactions

  • #30 QldbDriver property pool_timeout has been removed.

  • #27 QldbDriver property retry_limit has been removed, instead use RetryConfig to specify retry_limit.

New features:

#27 Custom Retry/Backoff policies

Developers can now choose to define Custom Backoff when a transaction is retried.
The RetryConfig can be specified as a property while creating an instance of QldbDriver. Also an instance of RetryConfig can be passed to QldbDriver.execute_lambda which will override the configuration defined on QldbDriver.

Usage

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 = RetryConfig(retry_limit=2, custom_backoff=custom_backoff)
qldb_driver = QldbDriver("test-ledger", retry_config=retry_config)

Check API docs for further details.

Added 'Getting Started' and 'Cookbook' to public api docs.

07 May 19:57
Compare
Choose a tag to compare

Documentation Fixes:

Added 'Getting Started' and 'Cookbook' to public api docs.