Skip to content

Commit 8447d55

Browse files
Merge branch 'develop' into feature/fix-etag-type
2 parents 4c78593 + 757db0e commit 8447d55

File tree

11 files changed

+176
-158
lines changed

11 files changed

+176
-158
lines changed

.github/workflows/on_schedule_monthly_roadmap_reminder.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,3 @@ jobs:
1616
uses: aws-powertools/actions/.github/workflows/monthly_roadmap_reminder.yml@fd4575466e5c2ac10703ac16f5aa9fb8890f532a
1717
with:
1818
token: ${{ github.token }}
19-
20-

.github/workflows/ossf_scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
repo_token: ${{ secrets.SCORECARD_TOKEN }} # read-only fine-grained token to read branch protection settings
3636

3737
- name: "Upload results"
38-
uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2
38+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
3939
with:
4040
name: SARIF file
4141
path: results.sarif

.github/workflows/publish_v2_layer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ jobs:
146146
- name: zip output
147147
run: zip -r cdk.out.zip cdk.out
148148
- name: Archive CDK artifacts
149-
uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2
149+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
150150
with:
151151
name: cdk-layer-artefact
152152
path: layer/cdk.out.zip
@@ -258,7 +258,7 @@ jobs:
258258
artifact_name: ${{ inputs.source_code_artifact_name }}
259259

260260
- name: Download CDK layer artifacts
261-
uses: actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d # v4.1.5
261+
uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6
262262
with:
263263
path: cdk-layer-stack
264264
pattern: cdk-layer-stack-* # merge all Layer artifacts created per region earlier (reusable_deploy_v2_layer_stack.yml; step "Save Layer ARN artifact")

.github/workflows/record_pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
script: |
5454
const script = require('.github/scripts/save_pr_details.js')
5555
await script({github, context, core})
56-
- uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2
56+
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
5757
with:
5858
name: pr
5959
path: pr.txt

.github/workflows/reusable_deploy_v2_layer_stack.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ jobs:
180180
- name: install deps
181181
run: poetry install
182182
- name: Download artifact
183-
uses: actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d # v4.1.5
183+
uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6
184184
with:
185185
name: ${{ inputs.artefact-name }}
186186
path: layer
@@ -197,7 +197,7 @@ jobs:
197197
cat cdk-layer-stack/${{ matrix.region }}-layer-version.txt
198198
- name: Save Layer ARN artifact
199199
if: ${{ inputs.stage == 'PROD' }}
200-
uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2
200+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
201201
with:
202202
name: cdk-layer-stack-${{ matrix.region }}
203203
path: ./layer/cdk-layer-stack/* # NOTE: upload-artifact does not inherit working-directory setting.

.github/workflows/reusable_deploy_v2_sar.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ jobs:
115115
with:
116116
node-version: ${{ env.NODE_VERSION }}
117117
- name: Download artifact
118-
uses: actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d # v4.1.5
118+
uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6
119119
with:
120120
name: ${{ inputs.artefact-name }}
121121
- name: Unzip artefact

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,29 @@
44
<a name="unreleased"></a>
55
# Unreleased
66

7+
## Code Refactoring
8+
9+
* **parser:** only infer type hints when necessary ([#4183](https://github.com/aws-powertools/powertools-lambda-python/issues/4183))
10+
711
## Documentation
812

913
* **idempotency:** fix highlight and import path ([#4154](https://github.com/aws-powertools/powertools-lambda-python/issues/4154))
14+
* **roadmap:** april updates ([#4181](https://github.com/aws-powertools/powertools-lambda-python/issues/4181))
1015

1116
## Maintenance
1217

18+
* **deps:** bump actions/checkout from 4.1.2 to 4.1.3 ([#4168](https://github.com/aws-powertools/powertools-lambda-python/issues/4168))
1319
* **deps:** bump actions/upload-artifact from 4.3.1 to 4.3.2 ([#4162](https://github.com/aws-powertools/powertools-lambda-python/issues/4162))
20+
* **deps:** bump actions/download-artifact from 4.1.5 to 4.1.6 ([#4178](https://github.com/aws-powertools/powertools-lambda-python/issues/4178))
21+
* **deps:** bump actions/upload-artifact from 4.3.2 to 4.3.3 ([#4177](https://github.com/aws-powertools/powertools-lambda-python/issues/4177))
1422
* **deps:** bump actions/download-artifact from 4.1.4 to 4.1.5 ([#4161](https://github.com/aws-powertools/powertools-lambda-python/issues/4161))
23+
* **deps-dev:** bump cdklabs-generative-ai-cdk-constructs from 0.1.121 to 0.1.123 ([#4176](https://github.com/aws-powertools/powertools-lambda-python/issues/4176))
24+
* **deps-dev:** bump aws-cdk-aws-lambda-python-alpha from 2.137.0a0 to 2.138.0a0 ([#4169](https://github.com/aws-powertools/powertools-lambda-python/issues/4169))
1525
* **deps-dev:** bump aws-cdk from 2.137.0 to 2.138.0 ([#4157](https://github.com/aws-powertools/powertools-lambda-python/issues/4157))
1626
* **deps-dev:** bump aws-cdk-lib from 2.137.0 to 2.138.0 ([#4160](https://github.com/aws-powertools/powertools-lambda-python/issues/4160))
17-
* **deps-dev:** bump cdklabs-generative-ai-cdk-constructs from 0.1.119 to 0.1.121 ([#4167](https://github.com/aws-powertools/powertools-lambda-python/issues/4167))
27+
* **deps-dev:** bump cfn-lint from 0.86.3 to 0.86.4 ([#4180](https://github.com/aws-powertools/powertools-lambda-python/issues/4180))
1828
* **deps-dev:** bump ruff from 0.3.7 to 0.4.1 ([#4166](https://github.com/aws-powertools/powertools-lambda-python/issues/4166))
29+
* **deps-dev:** bump cdklabs-generative-ai-cdk-constructs from 0.1.119 to 0.1.121 ([#4167](https://github.com/aws-powertools/powertools-lambda-python/issues/4167))
1930

2031

2132
<a name="v2.37.0"></a>

aws_lambda_powertools/utilities/parser/parser.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,17 @@ def handler(event: Order, context: LambdaContext):
8383
When envelope given does not implement BaseEnvelope
8484
"""
8585

86-
# The first parameter of a Lambda function is always the event
87-
# This line get the model informed in the event_parser function
88-
# or the first parameter of the function by using typing.get_type_hints
89-
type_hints = typing.get_type_hints(handler)
90-
model = model or (list(type_hints.values())[0] if type_hints else None)
9186
if model is None:
92-
raise InvalidModelTypeError(
93-
"The model must be provided either as the `model` argument to `event_parser`"
94-
"or as the type hint of `event` in the handler that it wraps",
95-
)
87+
# The first parameter of a Lambda function is always the event.
88+
# Get the first parameter's type by using typing.get_type_hints.
89+
type_hints = typing.get_type_hints(handler)
90+
if type_hints:
91+
model = list(type_hints.values())[0]
92+
if model is None:
93+
raise InvalidModelTypeError(
94+
"The model must be provided either as the `model` argument to `event_parser`"
95+
"or as the type hint of `event` in the handler that it wraps",
96+
)
9697

9798
if envelope:
9899
parsed_event = parse(event=event, model=model, envelope=envelope)

0 commit comments

Comments
 (0)