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

new feature: Add docs about conditional write for s3 #5097

Closed
1 task
wcy-fdu opened this issue Sep 5, 2024 · 6 comments · Fixed by #5129 or #5142
Closed
1 task

new feature: Add docs about conditional write for s3 #5097

wcy-fdu opened this issue Sep 5, 2024 · 6 comments · Fixed by #5129 or #5142
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed

Comments

@wcy-fdu
Copy link
Contributor

wcy-fdu commented Sep 5, 2024

Feature Description

Recently s3 introduce conditional write, which can check if an object exists before creating it. This feature can help user more easily prevent the application from overwriting any existing objects when uploading data.
refer to https://aws.amazon.com/about-aws/whats-new/2024/08/amazon-s3-conditional-writes/?nc1=h_ls

Problem and Solution

Additional Context

No response

Are you willing to contribute to the development of this feature?

  • Yes, I am willing to contribute to the development of this feature.
@wcy-fdu wcy-fdu added the enhancement New feature or request label Sep 5, 2024
@Xuanwo
Copy link
Member

Xuanwo commented Sep 5, 2024

Already supported by write_with(path).if_none_match("*"). We can improvide our documantation and tests to make it clear.

For example, we can add a test that writes with if_none_match("*") to a path where a file exists; we should have a condition not matched error.

@Xuanwo Xuanwo changed the title new feature: support conditional write for s3 new feature: Add docs about conditional write for s3 Sep 5, 2024
@wcy-fdu
Copy link
Contributor Author

wcy-fdu commented Sep 5, 2024

Already supported by write_with(path).if_none_match("*"). We can improvide our documantation and tests to make it clear.

So fast, this feature is only available on August 20th.

@Xuanwo Xuanwo added documentation Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed and removed enhancement New feature or request labels Sep 5, 2024
@Xuanwo
Copy link
Member

Xuanwo commented Sep 5, 2024

So fast, this feature is only available on August 20th.

Luckily, AWS S3 implemented this feature in the same way OpenDAL designed its API...

@ForestLH
Copy link
Contributor

ForestLH commented Sep 6, 2024

I am new to opendal, can i try this? Thanks.

@Xuanwo
Copy link
Member

Xuanwo commented Sep 6, 2024

I am new to opendal, can i try this? Thanks.

Sure! We can add if_none_match for s3 write first, for example:

if let Some(if_none_match) = args.if_none_match() {
req = req.header(IF_NONE_MATCH, if_none_match);

@ForestLH
Copy link
Contributor

I am new to opendal, can i try this? Thanks.

Sure! We can add if_none_match for s3 write first, for example:

if let Some(if_none_match) = args.if_none_match() {
req = req.header(IF_NONE_MATCH, if_none_match);

Thanks! That's very helpful to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
3 participants