-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
chore(iot-events): support all binary operators #19889
chore(iot-events): support all binary operators #19889
Conversation
/** | ||
* Create a expression as String from the given string. | ||
*/ | ||
public static asString(value: string): Expression { |
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.
Why the rename from fromString
to asString
? asString
implies a conversion to me, which is not what is happening.
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.
Currently, when users want to use literal string in the expression, it is needed to use fromString
with double-quotes as following:
fromString('"my-data"')
And when users want to use literal number, it is needed to use fromString
with string as following:
fromString('12.5')
Actually, I want to provide fromString
and fromNumber
as following:
fromString('my-data') // double-quotes is not needed
fromNumber(12.5) // apply number instead of string
But already I have used fromString
name space...
literalString
and literalNumber
are better?
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.
In this case, the iotevents-actions
package seems to be experimental, which means we are technically allowed to break its behavior in breaking ways if we figure out we made a mistake in the past (that's what the point of that stability is).
So I'd prefer for us to keep the prime real estate names, and change the behavior of fromString
and fromNumber
to have the desired behavior.
If you are concerned about inconveniencing users, fair enough and I love that instinct. We can choose to do one of the following things:
- Introduce a feature flag to gate the old vs new behavior of the
fromString()
method. - Introduce a new method (immediately
@deprecate
d) namedlegacyFromString()
or something, and clearly explain in the PR body that users relying on the old behavior should either fix their code or switch to the other method.
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.
@rix0rrr
Thanks for your suggestion!
I have reverted the commit for asString
and asNumber
. And I will implement fromString
and fromNumber
as breaking change in another PR. Because it will have small changing some tests already written.
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'm creating the PR yamatatsu#30 for breaking change of the behavior of Expression.fromString()
.
@yamatatsu Ouch. Another one our branch change blew up. Sorry that the lag in our reviews has caused so much extra work overall. |
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.
Just putting this in changes requested so that I'll be able to tell more easily when it's been rebased.
a63fc40
to
bcda92d
Compare
Pull request has been modified.
@TheRealAmazonKendra |
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). |
This PR adds rest binary operators of IoT Events. This PR does not add new integ tests because of [this conversation](aws#19329 (comment)). ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This PR adds rest binary operators of IoT Events.
This PR does not add new integ tests because of this conversation.
All Submissions:
Adding new Unconventional Dependencies:
New Features
yarn integ
to deploy the infrastructure and generate the snapshot (i.e.yarn integ
without--dry-run
)?By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license