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

feat: implement new options into bwrite command #190

Merged
merged 4 commits into from
Apr 9, 2024

Conversation

tmyoda
Copy link
Contributor

@tmyoda tmyoda commented Nov 2, 2023

Issue #, if available:
#164

Description of changes:
Introduce new options into put command. This commit adds new command options, --put and --del.

dy bwrite --put '{Dynein format}' --put '{Dynein format}' --del '{Dynein format}'

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@tmyoda
Copy link
Contributor Author

tmyoda commented Nov 2, 2023

/snapshot

Copy link

github-actions bot commented Nov 2, 2023

Start taking snapshots for this pull request.
https://github.com/awslabs/dynein/actions/runs/6730427967

@tmyoda
Copy link
Contributor Author

tmyoda commented Nov 2, 2023

/snapshot

Copy link

github-actions bot commented Nov 2, 2023

Start taking snapshots for this pull request.
https://github.com/awslabs/dynein/actions/runs/6730473189

@tmyoda tmyoda force-pushed the improve-parsing-bwrite branch 5 times, most recently from e00dec6 to 77cfba3 Compare November 5, 2023 19:04
@tmyoda tmyoda marked this pull request as ready for review November 5, 2023 19:08
@tmyoda tmyoda requested a review from StoneDot November 7, 2023 13:13
@tmyoda tmyoda mentioned this pull request Jan 21, 2024
23 tasks
@tmyoda tmyoda force-pushed the improve-parsing-bwrite branch 3 times, most recently from f1a1076 to 91c2e2e Compare January 25, 2024 23:59
Copy link
Contributor

@StoneDot StoneDot left a comment

Choose a reason for hiding this comment

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

Thank you for implementing a great PR. I left comments. Could you check them? I'm not sure of the reason for CI failure currently. But I think redundant tm creation may be a cause.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
src/batch.rs Outdated Show resolved Hide resolved
tests/bwrite.rs Outdated Show resolved Hide resolved
tests/bwrite.rs Outdated Show resolved Hide resolved
tests/bwrite.rs Outdated Show resolved Hide resolved
tests/bwrite.rs Outdated Show resolved Hide resolved
tests/bwrite.rs Outdated Show resolved Hide resolved
@StoneDot StoneDot added the enhancement New feature or request label Mar 1, 2024
@tmyoda tmyoda force-pushed the improve-parsing-bwrite branch from b96b296 to eb67542 Compare March 24, 2024 16:42
@tmyoda tmyoda requested a review from StoneDot March 26, 2024 16:55
@tmyoda
Copy link
Contributor Author

tmyoda commented Mar 26, 2024

Thank you for the thorough review of this PR. I pushed the changes based on your comment.
Could you please take a look this again?

Copy link
Contributor

@StoneDot StoneDot left a comment

Choose a reason for hiding this comment

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

Thank you for updating the PR. Could you please check the comments I left?

README.md Outdated
```

```bash
$ dy bwrite --del '{"pk": "1"}' --del '{"pk": "2"}' --put '{"pk": "3", "this_is_set": <<"a","b","c">>}' --input request.json
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: There are two spaces before --input.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

README.md Outdated
2 {"this_is_set":["x","y","z"]}
```

The --put, --del, and --input options can be used simultaneously.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Forget to quote backticks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
src/batch.rs Show resolved Hide resolved
src/batch.rs Outdated
@@ -501,3 +570,68 @@ fn json_binary_val_to_bytes(v: &JsonValue) -> Bytes {
.expect("binary inputs should be base64 with padding encoded"),
)
}

// Check if the item has a partition key and sort key.
fn validate_item_has_keys(
Copy link
Contributor

Choose a reason for hiding this comment

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

This method also checks key types. We need to change the name of this method to reflect actual work. For instance, validate_item_keys makes sense to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

tests/util/mod.rs Show resolved Hide resolved
@tmyoda tmyoda force-pushed the improve-parsing-bwrite branch from 498d40a to 0514bee Compare April 7, 2024 01:40
@tmyoda tmyoda requested review from a team as code owners April 7, 2024 01:40
@tmyoda tmyoda force-pushed the improve-parsing-bwrite branch from 0514bee to d52a666 Compare April 7, 2024 01:47
@tmyoda tmyoda force-pushed the improve-parsing-bwrite branch from d52a666 to 5b17141 Compare April 7, 2024 01:51
@tmyoda tmyoda requested a review from StoneDot April 7, 2024 01:55
@tmyoda
Copy link
Contributor Author

tmyoda commented Apr 7, 2024

Thanks for the insightful review. I've fixed the points based on your comment and squashed the fixup commits.
Could you please check it again? Thanks.

Copy link
Contributor

@StoneDot StoneDot left a comment

Choose a reason for hiding this comment

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

I am expressing my sincere appreciation for your continuous efforts to enhance the code quality. The improvements you've made are truly remarkable. LGTM, and I will proudly merge your work.

@StoneDot StoneDot merged commit 48e569e into awslabs:main Apr 9, 2024
3 checks passed
KIrie-0217 pushed a commit to KIrie-0217/dynein that referenced this pull request May 15, 2024
feat: implement new options into bwrite command

---------

Signed-off-by: Tomoya Oda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants