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

service/dynamodb/expression: Add IsSet helper for ConditionBuilder and KeyConditionBuilder #494

Merged
merged 6 commits into from
Apr 7, 2020
Merged

service/dynamodb/expression: Add IsSet helper for ConditionBuilder and KeyConditionBuilder #494

merged 6 commits into from
Apr 7, 2020

Conversation

alextbok
Copy link
Contributor

@alextbok alextbok commented Feb 27, 2020

Adds IsSet method to the ConditionBuilder and KeyConditionBuilder types. This methods makes it easier to discover if the condition builders have any conditions added to them.

Implements #493.

@jasdel jasdel changed the title (#493) service/dynamodb/expression: add IsSet api for ConditionBuilder and KeyConditionBuilder service/dynamodb/expression: add IsSet api for ConditionBuilder and KeyConditionBuilder Apr 2, 2020
@jasdel jasdel added the pr/needs-review This PR needs a review from a Member. label Apr 2, 2020
@jasdel jasdel changed the title service/dynamodb/expression: add IsSet api for ConditionBuilder and KeyConditionBuilder service/dynamodb/expression: Add IsSet method for ConditionBuilder and KeyConditionBuilder Apr 2, 2020
@jasdel jasdel requested review from skotambkar and jasdel April 2, 2020 00:37
@jasdel jasdel changed the title service/dynamodb/expression: Add IsSet method for ConditionBuilder and KeyConditionBuilder service/dynamodb/expression: Add IsSet helper for ConditionBuilder and KeyConditionBuilder Apr 2, 2020
Copy link
Contributor

@jasdel jasdel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time to create this PR @alextbok. Sorry for taking so long to get back to you on it.

To help discoverability of this feature what do you think moving this to a method on the ConditionBuilder, and KeyConditionBuilder types? As a method it would be easier to find.

e.g.

func (b ConditionBuilder) HasConditions() bool {...}
func (b KeyConditionBuilder) HasConditions() bool {...}

@alextbok
Copy link
Contributor Author

alextbok commented Apr 3, 2020

Thanks @jasdel. I just made the requested changes. You mentioned the signature as HasConditions but the changelog specified the original IsSet, so I just kept IsSet, which I feel is more consistent with the internal package terminology (as well as the unset error message that is exposed), but let me know if you'd prefer HasConditions and I'll update the code and changelog

@jasdel jasdel self-requested a review April 7, 2020 18:42
Copy link
Contributor

@jasdel jasdel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates @alextbok these changes look good. we'll get this merged in and releases shortly. Using IsSet works for the naming of this method.

@jasdel jasdel merged commit 2bc00eb into aws:master Apr 7, 2020
jasdel added a commit that referenced this pull request Apr 21, 2020
===

Breaking Change
---
* `aws/endpoints`: Several functions and types have been removed
  * Removes `DecodeModel` and `DecodeModelOptions` from the package ([#509](#509))
  * Remove Region Constants, Partition Constants, and types use for exploring the endpoint data model ([#512](#512))
* `service/s3/s3crypto`: Package and associated encryption/decryption clients have been removed from the SDK ([#511](#511))
* `aws/external`: Removes several export constants and types ([#508](#508))
  * No longer exports AWS environment constants used by the external environment configuration loader
  * `DefaultSharedConfigProfile` is now defined an exported constant
* `aws`: `ErrMissingRegion`, `ErrMissingEndpoint`, `ErrStaticCredentialsEmpty` are now concrete error types ([#510](#510))

Services
---
* Synced the V2 SDK with latest AWS service API definitions.

SDK Features
---
* `aws/signer/v4`: New methods `SignHTTP` and `PresignHTTP` have been added ([#519](#519))
  * `SignHTTP` replaces `Sign`, and usage of `Sign` should be migrated before it's removal at a later date
  * `PresignHTTP` replaces `Presign`, and usage of `Presign` should be migrated before it's removal at a later date
  * `DisableRequestBodyOverwrite` and `UnsignedPayload` are now deprecated options and have no effect on `SignHTTP` or `PresignHTTP`. These options will be removed at a later date.
* `aws/external`: Add Support for setting a default fallback region and resolving region from EC2 IMDS ([#523](#523))
  * `WithDefaultRegion` helper has been added which can be passed to `LoadDefaultAWSConfig`
    * This helper can be used to configure a default fallback region in the event a region fails to be resolved from other sources
  * Support has been added to resolve region using EC2 IMDS when available
    * The IMDS region will be used if region as not found configured in either the shared config or the process environment.
  * Fixes [#244](#244)
  * Fixes [#515](#515)
SDK Enhancements
---
* `service/dynamodb/expression`: Add IsSet helper for ConditionBuilder and KeyConditionBuilder ([#494](#494))
  * Adds a IsSet helper for ConditionBuilder and KeyConditionBuilder to make it easier to determine if the condition builders have any conditions added to them.
  * Implements [#493](#493).
* `internal/ini`: Normalize Section keys to lowercase ([#495](#495))
  * Update's SDK's ini utility to store all keys as lowercase. This brings the SDK inline with the AWS CLI's behavior.

SDK Bugs
---
* `internal/sdk`: Fix SDK's UUID utility to handle partial read ([#536](#536))
  * Fixes the SDK's UUID utility to correctly handle partial reads from its crypto rand source. This error was sometimes causing the SDK's InvocationID value to fail to be obtained, due to a partial read from crypto.Rand.
  * Fix [#534](#534)
* `aws/defaults`: Fix request metadata headers causing signature errors ([#536](#536))
    * Fixes the SDK's adding the request metadata headers in the wrong location within the request handler stack. This created a situation where a request that was retried would sign the new attempt using the old value of the header. The header value would then be changed before sending the request.
    * Fix [#533](#533)
    * Fix [#521](#521)
jasdel added a commit that referenced this pull request Apr 22, 2020
Breaking Change
---
* `aws/endpoints`: Several functions and types have been removed
  * Removes `DecodeModel` and `DecodeModelOptions` from the package ([#509](#509))
  * Remove Region Constants, Partition Constants, and types use for exploring the endpoint data model ([#512](#512))
* `service/s3/s3crypto`: Package and associated encryption/decryption clients have been removed from the SDK ([#511](#511))
* `aws/external`: Removes several export constants and types ([#508](#508))
  * No longer exports AWS environment constants used by the external environment configuration loader
  * `DefaultSharedConfigProfile` is now defined an exported constant
* `aws`: `ErrMissingRegion`, `ErrMissingEndpoint`, `ErrStaticCredentialsEmpty` are now concrete error types ([#510](#510))

Services
---
* Synced the V2 SDK with latest AWS service API definitions.

SDK Features
---
* `aws/signer/v4`: New methods `SignHTTP` and `PresignHTTP` have been added ([#519](#519))
  * `SignHTTP` replaces `Sign`, and usage of `Sign` should be migrated before it's removal at a later date
  * `PresignHTTP` replaces `Presign`, and usage of `Presign` should be migrated before it's removal at a later date
  * `DisableRequestBodyOverwrite` and `UnsignedPayload` are now deprecated options and have no effect on `SignHTTP` or `PresignHTTP`. These options will be removed at a later date.
* `aws/external`: Add Support for setting a default fallback region and resolving region from EC2 IMDS ([#523](#523))
  * `WithDefaultRegion` helper has been added which can be passed to `LoadDefaultAWSConfig`
    * This helper can be used to configure a default fallback region in the event a region fails to be resolved from other sources
  * Support has been added to resolve region using EC2 IMDS when available
    * The IMDS region will be used if region as not found configured in either the shared config or the process environment.
  * Fixes [#244](#244)
  * Fixes [#515](#515)

SDK Enhancements
---
* `service/dynamodb/expression`: Add IsSet helper for ConditionBuilder and KeyConditionBuilder ([#494](#494))
  * Adds a IsSet helper for ConditionBuilder and KeyConditionBuilder to make it easier to determine if the condition builders have any conditions added to them.
  * Implements [#493](#493).
* `internal/ini`: Normalize Section keys to lowercase ([#495](#495))
  * Update's SDK's ini utility to store all keys as lowercase. This brings the SDK inline with the AWS CLI's behavior.


SDK Bugs
---
* `internal/sdk`: Fix SDK's UUID utility to handle partial read ([#536](#536))
  * Fixes the SDK's UUID utility to correctly handle partial reads from its crypto rand source. This error was sometimes causing the SDK's InvocationID value to fail to be obtained, due to a partial read from crypto.Rand.
  * Fix [#534](#534)
* `aws/defaults`: Fix request metadata headers causing signature errors ([#536](#536))
    * Fixes the SDK's adding the request metadata headers in the wrong location within the request handler stack. This created a situation where a request that was retried would sign the new attempt using the old value of the header. The header value would then be changed before sending the request.
    * Fix [#533](#533)
    * Fix [#521](#521)
zaquestion pushed a commit to zaquestion/aws-sdk-go-v2 that referenced this pull request Jul 1, 2021
These changes were present in an older version of the expression package before it was moved, originally added in aws#494, when the expression library was reintroduce in aws#981 these changes werent included for some reason, but the need for checking if a condition is set or not still exists
skmcgrail added a commit that referenced this pull request Jul 21, 2021
* feat: (feature/dynamodb/expression) readd IsSet methods

These changes were present in an older version of the expression package before it was moved, originally added in #494, when the expression library was reintroduce in #981 these changes werent included for some reason, but the need for checking if a condition is set or not still exists

* Add Change Annotation

Co-authored-by: Sean McGrail <[email protected]>
jrichard8 pushed a commit to jrichard8/aws-sdk-go-v2 that referenced this pull request Feb 14, 2022
* feat: (feature/dynamodb/expression) readd IsSet methods

These changes were present in an older version of the expression package before it was moved, originally added in aws#494, when the expression library was reintroduce in aws#981 these changes werent included for some reason, but the need for checking if a condition is set or not still exists

* Add Change Annotation

Co-authored-by: Sean McGrail <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/needs-review This PR needs a review from a Member.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants