Skip to content
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

(stepfunctions): No replacement for JSONPath.numberAt, etc. #33343

Closed
1 task
snowe2010 opened this issue Feb 7, 2025 · 2 comments
Closed
1 task

(stepfunctions): No replacement for JSONPath.numberAt, etc. #33343

snowe2010 opened this issue Feb 7, 2025 · 2 comments
Labels
@aws-cdk/aws-stepfunctions Related to AWS StepFunctions bug This issue is a bug.

Comments

@snowe2010
Copy link

Describe the bug

Previously with step functions steps like DynamoPutItem, we were able to do DynamoAttributeValue.fromNumber(JsonPath.numberAt(key)), which would use JSONPath to access the number and save the number in dynamo. With JSONata it seems like there is no replacement for this. I tried DynamoAttributeValue.numberFromString("$states.input.blah") but that fails with The parameter cannot be converted to a numeric value: $states.input.blah, as I'm pretty sure that's for turning a string like "1" into the numeric in DDB.

This is most likely a missed part of the addition of JSONata, and not a bug, but it still prevents migration to JSONata for any Dynamo related steps. There are other functions in the DynamoAttributeValue class like listFromJsonata, mapFromJsonata, and booleanFromJsonata so I'm unsure whether this should be a new method on the DynamoAttributeValue class or if it should be its own replacement like JSONata.numberAt.

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

I would either expect to have a new class software.amazon.awscdk.services.stepfunctions.JSONata with functions equivalent to those of software.amazon.awscdk.services.stepfunctions.JSONPath, or for there to be methods on DynamoAttributeValue for JSONata.

Current Behavior

No ability to translate JSONata paths into Dynamo attributes.

Reproduction Steps

There is no reproduction for this because there is no function to achieve this. The bug is a missing method or class.

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.178.0

Framework Version

2.178.0

Node.js Version

v22.8.0

OS

macOS

Language

Java

Language Version

Kotlin 2.1.10 JVM 21

Other information

No response

@snowe2010 snowe2010 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 7, 2025
@github-actions github-actions bot added the @aws-cdk/aws-stepfunctions Related to AWS StepFunctions label Feb 7, 2025
@snowe2010
Copy link
Author

Never mind, I was forgetting to use {% %} in the string, so the correct solution is DynamoAttributeValue.numberFromString("{% $states.input.blah %}")

Copy link

github-actions bot commented Feb 7, 2025

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 7, 2025
@pahud pahud removed the needs-triage This issue or PR still needs to be triaged. label Feb 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
@aws-cdk/aws-stepfunctions Related to AWS StepFunctions bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants