v1.21.0 #737
Closed
heitorlessa
started this conversation in
Show and tell
v1.21.0
#737
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
After some vacation period, we're back with a new minor release with major features:
New Contributors
I'd like to personally thank our new contributors to the project :)
Detailed changes
Boto3 sessions
You can now pass in your own boto3 session when using Parameters, Batch, and Idempotency.
This is helpful in two typical scenarios: 1/ You want to run an operation in another account like fetching secrets/parameters somewhere else, 2/ Use snapshot testing tools like Placebo that will replay session data that happened earlier when doing unit testing.
Feature flags
There's been three main improvements in Feature flags utility as part of this release: New rule conditions, Bring your own Logger for debugging, and Getting a copy of fetched configuration from the store
New rule conditions
You can now use the following new rule conditions to evaluate your feature flags for inequality, comparison, and more explicit contains logic, where
a
is the key andb
is the value passed as a context input for evaluation:lambda a, b: a > b
lambda a, b: a >= b
lambda a, b: a < b
lambda a, b: a <= b
lambda a, b: a in b
lambda a, b: a not in b
lambda a, b: b in a
lambda a, b: b not in a
Example
Accessing raw configuration fetched
Previously, if you were using a single application configuration and a feature schema in a single AppConfig key, we would only use the feature flags schema and discard the rest.
You can now access the raw configuration with a new property
get_raw_configuration
within AppConfig Store:Unit testing idempotency
We have improved how you can unit test your code when using @idempotent and @idempotent_function decorators.
You can now disable all interactions with the idempotence store using
POWERTOOLS_IDEMPOTENCY_DISABLED
environment variable, and monkeypatch the DynamoDB resource client Idempotency utility uses if you wish to either use DynamoDB Local or mock all I/O operations.New data elements for JSON Schema validation errors
When validating input/output with the Validator, you can now access new properties in
SchemaValidationError
to more easily construct your custom errors based on what went wrong.Property | Type | Description
------------------------------------------------- | ---------------------------------------------------------------------------------
message
| str | Powertools formatted error messagevalidation_message
| str, optional | Containing human-readable information what is wrong, e.g.data.property[index] must be smaller than or equal to 42
name
| str, optional | name of a path in the data structure, e.g.data.property[index]
path
| List, optional |path
as an array in the data structure, e.g.['data', 'property', 'index']
value
| Any, optional | The invalid value, e.g.{"message": "hello world"}
definition
| Any, optional | JSON Schema definitionrule
| str, optional |rule
which thedata
is breaking (e.g.maximum
,required
)rule_definition
| Any, optional | The specific ruledefinition
(e.g.42
,['message', 'username']
)Sample
New JMESPath Powertools functions
Last but not least, as part of a documentation revamp in Idempotency by @walmsles, we're now exposing an internal feature used by many Lambda Powertools utilities which is the ability to extract and decode JSON objects.
You can now use JMESPath (JSON Query language) Lambda Powertools functions to easily decode and deserialize JSON often found as compressed (Kinesis, CloudWatch Logs, etc), as strings (SNS, SQS, EventBridge, API Gateway, etc), or as base64 (Kinesis).
We're exposing three custom JMESPath functions you can use such as
powertools_json
,powertools_base64
,powertools_base64_gzip
, and a new standalone function that will use JMESPath to search and extract the data you want calledextract_data_from_envelope
.Sample
SNS sample using built-in envelope
Changes
🌟New features and non-breaking changes
🌟 Minor Changes
📜 Documentation updates
🐛 Bug and hot fixes
🔧 Maintenance
This release was made possible by the following contributors:
@DanyC97, @Tankanow, @cakepietoast, @dependabot, @dependabot[bot], @gwlester, @heitorlessa, @michaelbrewer, @risenberg-cyberark and @walmsles
Full Changelog: v1.20.2...v1.21.0
This discussion was created from the release v1.21.0.
Beta Was this translation helpful? Give feedback.
All reactions