Skip to content

Commit 97c17c9

Browse files
author
Michael Brewer
committed
Merge branch 'develop' into feat-api-gw-auth-v2
2 parents 7d557f4 + 16563bb commit 97c17c9

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

.github/workflows/python_build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
max-parallel: 4
1818
matrix:
19-
python-version: [3.6, 3.7, 3.8]
19+
python-version: [3.6, 3.7, 3.8, 3.9]
2020
env:
2121
OS: ${{ matrix.os }}
2222
PYTHON: ${{ matrix.python-version }}

aws_lambda_powertools/utilities/data_classes/kinesis_stream_event.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,13 @@ def sequence_number(self) -> str:
3131
"""The unique identifier of the record within its shard"""
3232
return self["kinesis"]["sequenceNumber"]
3333

34+
def data_as_bytes(self) -> bytes:
35+
"""Decode binary encoded data as bytes"""
36+
return base64.b64decode(self.data)
37+
3438
def data_as_text(self) -> str:
3539
"""Decode binary encoded data as text"""
36-
return base64.b64decode(self.data).decode("utf-8")
40+
return self.data_as_bytes().decode("utf-8")
3741

3842
def data_as_json(self) -> dict:
3943
"""Decode binary encoded data as json"""

poetry.lock

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tool.poetry]
22
name = "aws_lambda_powertools"
33
version = "1.19.0"
4-
description = "A suite of utilities for AWS Lambda functions to ease adopting best practices such as tracing, structured logging, custom metrics, and more."
4+
description = "A suite of utilities for AWS Lambda functions to ease adopting best practices such as tracing, structured logging, custom metrics, batching, idempotency, feature flags, and more."
55
authors = ["Amazon Web Services"]
66
include = ["aws_lambda_powertools/py.typed"]
77
classifiers=[
@@ -12,6 +12,7 @@ classifiers=[
1212
"Programming Language :: Python :: 3.6",
1313
"Programming Language :: Python :: 3.7",
1414
"Programming Language :: Python :: 3.8",
15+
"Programming Language :: Python :: 3.9",
1516
]
1617
repository="https://github.com/awslabs/aws-lambda-powertools-python"
1718
readme = "README.md"
@@ -22,7 +23,7 @@ license = "MIT-0"
2223
python = "^3.6.1"
2324
aws-xray-sdk = "^2.8.0"
2425
fastjsonschema = "^2.14.5"
25-
boto3 = "^1.12"
26+
boto3 = "^1.18"
2627
jmespath = "^0.10.0"
2728
pydantic = {version = "^1.8.2", optional = true }
2829
email-validator = {version = "*", optional = true }

tests/functional/test_data_classes.py

+1
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,7 @@ def test_kinesis_stream_event():
10881088
assert kinesis.partition_key == "1"
10891089
assert kinesis.sequence_number == "49590338271490256608559692538361571095921575989136588898"
10901090

1091+
assert kinesis.data_as_bytes() == b"Hello, this is a test."
10911092
assert kinesis.data_as_text() == "Hello, this is a test."
10921093

10931094

0 commit comments

Comments
 (0)