-
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
step functions: Map.jsonata does not support assign #33403
Comments
Hi @joerino96, Thank you for reporting this issue. After investigation, this appears to be a valid bug where the Issue Analysis:
Current Workaround: new Map(scope, "MyMap", {
queryLanguage: QueryLanguage.JSONATA,
items: ProvideItems.jsonata("{% $runInput %}"),
itemSelector: {
runs: "{% $states.context.Map.Item.Value %}",
},
assign: {},
}) We'll work on fixing this by updating the MapJsonataProps interface to include the assign property. Making it a p1. |
…#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*
### 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* --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Comments on closed issues and PRs are hard for our team to see. |
### Issue # (if applicable) Closes aws#33403 and aws#33374 and aws#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* --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Describe the bug
Map.jsonata does not support the assign field provided by CDK, causing a compile error.
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
Map.jsonata is able to set the assign field.
Current Behavior
A compile error is thrown:
Object literal may only specify known properties, and 'assign' does not exist in type 'MapJsonataProps'.
Reproduction Steps
The following code causes a compile error:
However, the workaround for using the classic Map constructor and setting the query language to jsonata compiles correctly.
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.178.1
Framework Version
No response
Node.js Version
Node 18
OS
macOS 15.3
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: