From ca0dc379e7f1c0a3f0633fed20ac94598b6cf08a Mon Sep 17 00:00:00 2001 From: Bo Bayles Date: Tue, 9 Dec 2025 11:38:51 -0600 Subject: [PATCH 1/4] Add dynamodb.parse_dynamodb_resp --- boto3_helpers/dynamodb.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/boto3_helpers/dynamodb.py b/boto3_helpers/dynamodb.py index aa2b0be..6bbbdcd 100644 --- a/boto3_helpers/dynamodb.py +++ b/boto3_helpers/dynamodb.py @@ -271,9 +271,23 @@ def load_dynamodb_json(text, use_decimal=False): ``decimal.Decimal`` objects. This matches the ``boto3`` client behavior, but is often inconvenient. """ + return parse_dynamodb_resp(loads(text), use_decimal=use_decimal) + +def parse_dynamodb_resp(data, use_decimal=False): + """Just like :func:`load_dynamodb_json`, but takes already-parsed ``data`` rather + than serialized JSON. + + .. code-block:: python + + from boto3 import resource as parse_dynamodb_resp + + text = {'Item': {'some_number': {'N': '100'}}} + info = load_dynamodb_json(text) + assert info['Item']['some_number'] == 100 + """ d = _CustomTypeDeserializer(use_decimal=use_decimal, decode_binary=True).deserialize ret = {} - for key, value in loads(text).items(): + for key, value in data.items(): if key == 'Item': ret['Item'] = {k: d(v) for k, v in value.items()} elif key == 'Items': From a501bee089690fb92da6c6ade4fbda1e68734595 Mon Sep 17 00:00:00 2001 From: Bo Bayles Date: Tue, 9 Dec 2025 11:40:06 -0600 Subject: [PATCH 2/4] Updates for version 2.6.0 --- .github/workflows/test_action.yml | 8 ++++---- setup.cfg | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test_action.yml b/.github/workflows/test_action.yml index 396971a..641e1cb 100644 --- a/.github/workflows/test_action.yml +++ b/.github/workflows/test_action.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v3 @@ -20,7 +20,7 @@ jobs: run: | python -m pip install -U pip . - name: Static checks - if: "matrix.python-version == '3.9'" + if: "matrix.python-version == '3.10'" run: | python -m pip install -U black flake8 make check @@ -29,12 +29,12 @@ jobs: python -m pip install -U coverage make coverage - name: Build docs - if: "matrix.python-version == '3.9'" + if: "matrix.python-version == '3.10'" run: | python -m pip install -U sphinx make docs - name: Build package - if: "matrix.python-version == '3.9'" + if: "matrix.python-version == '3.10'" run: | python -m pip install -U twine wheel make package diff --git a/setup.cfg b/setup.cfg index a4b55b9..697bb4d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = boto3-helpers -version = 2.5.0 +version = 2.6.0 description = Helper utilities for boto3 long_description = file: README.rst long_description_content_type = text/x-rst @@ -18,7 +18,7 @@ project_urls = [options] packages = find: -python_requires = >=3.8 +python_requires = >=3.10 install_requires = boto3 botocore From 26b1cb49ecdde1c6591496af941c5c31dc2f91fa Mon Sep 17 00:00:00 2001 From: Bo Bayles Date: Tue, 9 Dec 2025 11:41:44 -0600 Subject: [PATCH 3/4] Re-format dynamodb module --- boto3_helpers/dynamodb.py | 1 + 1 file changed, 1 insertion(+) diff --git a/boto3_helpers/dynamodb.py b/boto3_helpers/dynamodb.py index 6bbbdcd..cf4add1 100644 --- a/boto3_helpers/dynamodb.py +++ b/boto3_helpers/dynamodb.py @@ -273,6 +273,7 @@ def load_dynamodb_json(text, use_decimal=False): """ return parse_dynamodb_resp(loads(text), use_decimal=use_decimal) + def parse_dynamodb_resp(data, use_decimal=False): """Just like :func:`load_dynamodb_json`, but takes already-parsed ``data`` rather than serialized JSON. From 16992e479ebfade9a0be266354141eea8e9875d3 Mon Sep 17 00:00:00 2001 From: Bo Bayles Date: Tue, 9 Dec 2025 11:44:06 -0600 Subject: [PATCH 4/4] Update MediaTailor test --- tests/test_mediatailor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_mediatailor.py b/tests/test_mediatailor.py index a79ee5d..120deac 100644 --- a/tests/test_mediatailor.py +++ b/tests/test_mediatailor.py @@ -41,7 +41,10 @@ def test_update_playback_configuration(self): 'Tags': {}, 'TranscodeProfileName': '', 'VideoContentSourceUrl': 'https://localhost/origin/hls/', - 'LogConfiguration': {'PercentEnabled': 1}, + 'LogConfiguration': { + 'PercentEnabled': 1, + 'EnabledLoggingStrategies': ['LEGACY_CLOUDWATCH'], + }, } get_params = {'Name': 'TestConfiguration'} stubber.add_response('get_playback_configuration', get_resp, get_params)