8000 Deprecate DynamoCommit (#373) by tustvold · Pull Request #374 · apache/arrow-rs-object-store · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Deprecate DynamoCommit (#373) #374

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

Merged
merged 1 commit into from
May 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/aws/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ impl ObjectStore for AmazonS3 {
r => r,
}
}
#[allow(deprecated)]
(PutMode::Create, S3ConditionalPut::Dynamo(d)) => {
d.conditional_op(&self.client, location, None, move || request.do_put())
.await
Expand Down Expand Up @@ -227,6 +228,7 @@ impl ObjectStore for AmazonS3 {
r => r,
}
}
#[allow(deprecated)]
S3ConditionalPut::Dynamo(d) => {
d.conditional_op(&self.client, location, Some(&etag), move || {
request.do_put()
Expand Down Expand Up @@ -366,6 +368,7 @@ impl ObjectStore for AmazonS3 {

return res;
}
#[allow(deprecated)]
Some(S3CopyIfNotExists::Dynamo(lock)) => {
return lock.copy_if_not_exists(&self.client, from, to).await
}
Expand Down Expand Up @@ -623,6 +626,7 @@ mod tests {
put_get_delete_list(&integration).await;

match &integration.client.config.copy_if_not_exists {
#[allow(deprecated)]
Some(S3CopyIfNotExists::Dynamo(d)) => dynamo::integration_test(&integration, d).await,
_ => eprintln!("Skipping dynamo integration test - dynamo not configured"),
};
Expand Down
8 changes: 8 additions & 0 deletions src/aws/precondition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ pub enum S3CopyIfNotExists {
/// See [`DynamoCommit`] for more information
///
/// This will use the same region, credentials and endpoint as configured for S3
#[deprecated(note = "Use S3CopyIfNotExists::Multipart")]
Dynamo(DynamoCommit),
}

Expand All @@ -80,6 +81,7 @@ impl std::fmt::Display for S3CopyIfNotExists {
write!(f, "header-with-status: {k}: {v}: {}", code.as_u16())
}
Self::Multipart => f.write_str("multipart"),
#[allow(deprecated)]
Self::Dynamo(lock) => write!(f, "dynamo: {}", lock.table_name()),
}
}
Expand Down Expand Up @@ -108,6 +110,7 @@ impl S3CopyIfNotExists {
code,
))
}
#[allow(deprecated)]
"dynamo" => Some(Self::Dynamo(DynamoCommit::from_str(value)?)),
_ => None,
}
Expand Down Expand Up @@ -147,6 +150,7 @@ pub enum S3ConditionalPut {
/// See [`DynamoCommit`] for more information
///
/// This will use the same region, credentials and endpoint as configured for S3
#[deprecated(note = "Use S3ConditionalPut::ETagMatch")]
Dynamo(DynamoCommit),

/// Disable `conditional put`
Expand All @@ -157,6 +161,7 @@ impl std::fmt::Display for S3ConditionalPut {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::ETagMatch => write!(f, "etag"),
#[allow(deprecated)]
Self::Dynamo(lock) => write!(f, "dynamo: {}", lock.table_name()),
Self::Disabled => write!(f, "disabled"),
}
Expand All @@ -169,6 +174,7 @@ impl S3ConditionalPut {
"etag" => Some(Self::ETagMatch),
"disabled" => Some(Self::Disabled),
trimmed => match trimmed.split_once(':')? {
#[allow(deprecated)]
("dynamo", s) => Some(Self::Dynamo(DynamoCommit::from_str(s)?)),
_ => None,
},
Expand Down Expand Up @@ -214,6 +220,7 @@ mod tests {
}

#[test]
#[allow(deprecated)]
fn parse_s3_copy_if_not_exists_dynamo() {
let input = "dynamo: table:100";
let expected = Some(S3CopyIfNotExists::Dynamo(
Expand All @@ -223,6 +230,7 @@ mod tests {
}

#[test]
#[allow(deprecated)]
fn parse_s3_condition_put_dynamo() {
let input = "dynamo: table:1300";
let expected = Some(S3ConditionalPut::Dynamo(
Expand Down
0