-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(stepfunctions): various JSONata query language fix #33404
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #33404 +/- ##
==========================================
+ Coverage 80.90% 81.00% +0.09%
==========================================
Files 236 238 +2
Lines 14261 14269 +8
Branches 2493 2492 -1
==========================================
+ Hits 11538 11558 +20
+ Misses 2438 2425 -13
- Partials 285 286 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Marking this PR as Also update the PR label to correctly reflect the issue priority. |
…#33423) ### Issue # (if applicable) Closes #33403 and #33374 and #33396. ### Reason for this change There are three issues here: 1. For summary, the first issue is basically that assign property cannot be accessed with using Map.jsonata(...) but available if we directly create map through new Map(...) using JSONATA query language. 2. For summary, the second issue is that JSONATA main PR added the outputs and assign property in the CatchProps interface for AddCatch functionality. But I don't think it's being used in the actual `addCatch` call https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-stepfunctions/lib/states/state.ts#L398. 3. Result writer and item reader class do not support using JSONATA. Deployment will fails due to if SFN is set to use JSONATA, it expects `Arguments` in the ASL instead of `Parameters`. ### Description of changes Fix both issues by fixing the interface inheritance and added the props to `AddCatch` method. Support `JSONATA` as the query language. ### Description of how you validated changes Added integ test and unit test to make sure that ### Checklist - [ ] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This review is outdated)
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thank you so much for fixing this bug. I'm very honored that you started working on this fix right away.
assign
and _addCatch
fix seems good! On the other hand, itemReader
and itemWriter
may need to be changes. In itemReader
and itemWriter
, whether to use Arguments
or Parameters
is determined only by the top-level or Map
state queryLanguage
. In this PR, users can use s3objectsitemReader.jsonata()
and s3objectsitemReader.jsonPath()
, but for example, s3objectsitemReader.jsonPath()
(i.e. Parameters
) can be used when the Map
state uses JSONata we can't.
// invalid cofigure
const distributedMap = sfn.DistributedMap.jsonPath(this, 'DistributedMap', {
itemReader: sfn.S3ObjectsItemReader.jsonata({
bucketNamePath: '{% $bucketName %}',
prefix: '{% $prefix %}',
}),
});
This should probably be processed projectively with CDK without relying on user specifications. Also, since the properties used in JSONata and JSONPath are not different, there is probably no need to use different constructors.
const distributedMap = sfn.DistributedMap.jsonPath(this, 'DistributedMap', {
itemReader: new sfn.S3ObjectsItemReader({
bucketName: '{% $bucketName %}',
prefix: '{% $prefix %}',
}),
});
packages/aws-cdk-lib/aws-stepfunctions/lib/states/distributed-map/item-reader.ts
Outdated
Show resolved
Hide resolved
packages/aws-cdk-lib/aws-stepfunctions/lib/states/distributed-map/item-reader.ts
Outdated
Show resolved
Hide resolved
packages/aws-cdk-lib/aws-stepfunctions/lib/states/distributed-map/item-reader.ts
Outdated
Show resolved
Hide resolved
packages/aws-cdk-lib/aws-stepfunctions/lib/states/distributed-map/item-reader.ts
Outdated
Show resolved
Hide resolved
@WinterYukky I addressed all your comments. Please give it another review once you're available. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Issue # (if applicable)
Closes #33403 and #33374 and #33396.
Reason for this change
There are three issues here:
addCatch
call https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-stepfunctions/lib/states/state.ts#L398.Arguments
in the ASL instead ofParameters
.Description of changes
Fix both issues by fixing the interface inheritance and added the props to
AddCatch
method.Support
JSONATA
as the query language.Description of how you validated changes
Added integ test and unit test to make sure that
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license