You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "amunra (via GitHub)" <gi...@apache.org> on 2023/11/03 15:39:38 UTC
[I] Required optional `ETag` on `.list()` [incubator-opendal]
amunra opened a new issue, #3477:
URL: https://github.com/apache/incubator-opendal/issues/3477
I'm developing against `s3s-fs` and using OpenDAL to read the data.
It looks like listing currently expects an `<ETag>` to be set, despite this being marked as optional in the Amazon docs.
The following seems to work around the problem.
I'll try and raise a proper PR for this tiny change, but I'd appreciate feedback in the meantime.
(I see @Xuanwo in the commit history for this part of the code, so tagging).
```diff
diff --git a/core/src/services/s3/pager.rs b/core/src/services/s3/pager.rs
index 3c5b15ed0..30646da8a 100644
--- a/core/src/services/s3/pager.rs
+++ b/core/src/services/s3/pager.rs
@@ -126,8 +126,10 @@ impl oio::Page for S3Pager {
let mut meta = Metadata::new(EntryMode::FILE);
- meta.set_etag(&object.etag);
- meta.set_content_md5(object.etag.trim_matches('"'));
+ if let Some(etag) = &object.etag {
+ meta.set_etag(&etag);
+ meta.set_content_md5(etag.trim_matches('"'));
+ }
meta.set_content_length(object.size);
// object.last_modified provides more precious time that contains
@@ -168,7 +170,7 @@ struct OutputContent {
size: u64,
last_modified: String,
#[serde(rename = "ETag")]
- etag: String,
+ etag: Option<String>,
}
#[derive(Default, Debug, Eq, PartialEq, Deserialize)]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Required optional `ETag` on `.list()` [incubator-opendal]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo closed issue #3477: Required optional `ETag` on `.list()`
URL: https://github.com/apache/incubator-opendal/issues/3477
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Required optional `ETag` on `.list()` [incubator-opendal]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on issue #3477:
URL: https://github.com/apache/incubator-opendal/issues/3477#issuecomment-1792776185
This patch LGTM, welcome to submit a PR for this. 👍
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org