-
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
docs(stepfunctions): use JsonPath.DISCARD
in place of null for input
#28661
Conversation
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.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
Does |
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
@mrgrain
The name Actually reading the doc on it, it could make sense ( |
if (value === NULL_SUBSTITUTE) { | ||
Object.assign(ret, handlers.handleNull(key, null)); |
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.
I didn't read the original issue, but just curious that does the following not work? The reason that it's completely ignoring null
value is because on line 162, we explicitly skipped null
or undefined
scenario. If we don't want to ignore it, can't we just assign a value instead?
if (value === null || value === undefined) {
Object.assign(ret, handlers.handleNull(key, null));
}
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.
I think users want to specifically be able to distinguish null
from undefined
in typescript, but at the same time the two are the same in other languages like Python (None
) so a magic value of some sort will satisfy both cases.
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.
@paulhcsun's right. This isn't an issue in TS (at least not as far as I know), but in jsii (languages) which cannot distinguish between null
and undefined
. But ASL (as a JSON-ish schema) sometimes requires users to use null
I believe this has been named based on this feature and assuming that the only time someone actually wants https://docs.aws.amazon.com/step-functions/latest/dg/input-output-resultpath.html If you look at the PRs and issue involved in
If we find that the naming/documentation for FWIW, after confirming |
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.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
JsonPath.DISCARD
in place of null for input
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Update docs for use of
sfn.JsonPath.DISCARD
in place ofnull
inTaskInput.fromObject
s field value for languages that do not supportnull
like Python.Doc: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.TaskInput.html#:~:text=to%20a%20task.-,static%20fromObject(obj),-public%20static%20fromObject
Closes #16253.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license