Releases: awslabs/amazon-qldb-driver-python
Release Pyqldb v3.2.4
What's Changed
- Prepare release 3.2.3 by @battesonb in #210
- Bump docutils from 0.19 to 0.20.1 by @dependabot in #209
- Update pytest-subtests requirement from ~=0.10.0 to ~=0.11.0 by @dependabot in #234
- Update pytest-cov requirement from ~=4.0.0 to ~=4.1.0 by @dependabot in #232
- Update sphinx requirement from ~=6.1.3 to ~=7.2.6 by @dependabot in #242
- Update botocore/boto3 requirement by @dependabot in #250
- Update amazon-ion requirement from ~=0.9.3 to ~=0.11.1 by @dependabot in #247
- Update pytest requirement from ~=7.2.2 to ~=7.4.0 by @dependabot in #221
- Revert "Update amazon-ion requirement from ~=0.9.3 to ~=0.11.1" by @shushen in #251
- chore: remove EoL Python 3.7 from test matrix and other CI improvements by @shushen in #252
- chore(deps): update boto3 requirement from ~=1.28.75 to ~=1.28.79 by @dependabot in #255
- chore(deps): update botocore requirement from ~=1.31.75 to ~=1.31.79 by @dependabot in #256
- chore(deps): update pytest requirement from ~=7.4.0 to ~=7.4.3 by @dependabot in #257
- Release v3.2.4 by @trstephen-amazon in #288
New Contributors
- @shushen made their first contribution in #251
- @trstephen-amazon made their first contribution in #288
Full Changelog: v3.2.3...v3.2.4
Release Pyqldb v3.2.3
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
Release 3.2.2
This release is to update ionhash Python package from 1.2.0 to 1.2.1.
🎉 Enhancements
- The Ion hash performance is hugely improved, and the informal benchmark result is in amazon-ion/ion-hash-python#22
Release Pyqldb v3.2.1
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
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
andbotocore
bumped to1.17.5
and1.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
Release 3.1.0
🎉 Enhancements
-
Added
get_consumed_ios
andget_timing_information
methods inBufferedCursor
andStreamCursor
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
andget_timing_information
methods in theStreamCursor
class are stateful, meaning the statistics returned by them reflect the state at the time of method execution.
-
Add
transaction_id
property inExecutor
to provide the Transaction ID if needed. -
The
Config
parameter ofQldbDriver
now appends theuser_agent_extra
value instead of overwriting it.
Release Pyqldb v3.0.0
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
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
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
propertypool_limit
has been renamed tomax_concurrent_transactions
-
#30
QldbDriver
propertypool_timeout
has been removed. -
#27
QldbDriver
propertyretry_limit
has been removed, instead useRetryConfig
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.
Documentation Fixes:
Added 'Getting Started' and 'Cookbook' to public api docs.