-
Notifications
You must be signed in to change notification settings - Fork 1.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
Provide meaningful string representation for DynamoDB Attr/Condition #3259
Comments
Thanks @rajveerappan for the feature request. I’ll plan to bring this up for discussion with the team next week to get their thoughts and will share any updates here. |
Thanks for your patience - this fell off our radar but still needs to be prioritized for team review. It looks like this may actually be a duplicate of an older issue: #1202. We try to consolidate overlapping issues in order to making tracking easier. Please let us know if there are any distinctions you want to highlight between these issues, otherwise I think we should continue tracking this in #1202. |
Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one. |
apologies, this fell off my radar as well. I had a PR open for this that had some feedback. I can try to clean that up. |
As I mentioned in #3608, this would also be a relatively large improvements to testing using Expected:
Got:
because lack of printing of e.g. the Once pretty-printing for conditions is fixed we could (in some future PR) also support diffing for test failures using |
@tibbe / @tim-finnigan I finished up the PR and tests, please take a look: #3254 |
@rajveerappan thanks for putting it together. Added a comment that I think is relevant at #3254 (comment) |
@tim-finnigan how can we get this PR merged? |
Hello @tim-finnigan, it looks like this issue overlaps with #4053 as well. I just rebased PR #3254 and pushed it up so it should be ready for re-review/merge. |
Describe the feature
Currently printing/logging a
FilterExpression
will show something like:which is not very helpful. Implementing
__str__
on the boto3Attr
andConditionBase
classes will instead result in logging like:Use Case
Improved human readable logging of DynamoDB
FilterExpression
sProposed Solution
#3254
The way this is implemented is by turning an
expression_format
which looks like{0} {operator} {1}
into something that looks like{values[0]} {operator} {values[1]}
which can be passed to the string format method using named indices.Other Information
An alternative solution would be to change all the
expression_format
s themselves to use a format like{values[0]} {operator} {values[1]}
but that would be a larger change and require updating the end consumers ofConditionBase#get_expression
.Avoiding the regex could also be accomplished by explicitly setting a new
str_expression_format
field that uses a format like{values[0]} {operator} {values[1]}
.Acknowledgements
SDK version used
latest
Environment details (OS name and version, etc.)
all
The text was updated successfully, but these errors were encountered: