This is an automated email from the ASF dual-hosted git repository.
tustvold pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs-object-store.git
The following commit(s) were added to refs/heads/main by this push:
new 9feebb9 Deprecate DynamoCommit (#373) (#374)
9feebb9 is described below
commit 9feebb9f83b8fd9b59667ab3e0367129c0a6236c
Author: Raphael Taylor-Davies <[email protected]>
AuthorDate: Mon May 19 13:46:36 2025 +0100
Deprecate DynamoCommit (#373) (#374)
---
src/aws/mod.rs | 4 ++++
src/aws/precondition.rs | 8 ++++++++
2 files changed, 12 insertions(+)
diff --git a/src/aws/mod.rs b/src/aws/mod.rs
index 9530e07..119ba10 100644
--- a/src/aws/mod.rs
+++ b/src/aws/mod.rs
@@ -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
@@ -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()
@@ -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
}
@@ -625,6 +628,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"),
};
diff --git a/src/aws/precondition.rs b/src/aws/precondition.rs
index ab5aea9..d23887c 100644
--- a/src/aws/precondition.rs
+++ b/src/aws/precondition.rs
@@ -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),
}
@@ -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()),
}
}
@@ -108,6 +110,7 @@ impl S3CopyIfNotExists {
code,
))
}
+ #[allow(deprecated)]
"dynamo" => Some(Self::Dynamo(DynamoCommit::from_str(value)?)),
_ => None,
}
@@ -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`
@@ -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"),
}
@@ -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,
},
@@ -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(
@@ -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(