You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note, to make this work in combination with the idempotent decorator we should allow for the generation of the idempotent key when combined with the @event_source decorator, otherwise there will be a type error when trying to generate the json. Example code which would raise a TypeError:
Runtime:
Python (but could apply to all languages that support decorators and lack existing libraries for event source data classes)
Is your feature request related to a problem? Please describe
Originally raises in the following issue: aws-powertools/powertools-lambda-python#434
Constructing a data class from an existing event could be cleaner, and tools like MyPy would complain about change the type of event
and the more version would mean an floating
event
variable:Describe the solution you'd like
Creating a thin decorator like
event_source
which just constructors an instance of the passed in class type would fix this.Describe alternatives you've considered
N/A
If you provide guidance, is this something you'd like to contribute?
Implementation see: aws-powertools/powertools-lambda-python#442
Additional context
Note, to make this work in combination with the idempotent decorator we should allow for the generation of the idempotent key when combined with the
@event_source
decorator, otherwise there will be a type error when trying to generate the json. Example code which would raise a TypeError:Fortunately this would be a simple fix:
The text was updated successfully, but these errors were encountered: