tustvold commented on code in PR #4792:
URL: https://github.com/apache/arrow-rs/pull/4792#discussion_r1318820909
##########
object_store/src/local.rs:
##########
@@ -274,13 +274,15 @@ impl ObjectStore for LocalFileSystem {
maybe_spawn_blocking(move || {
let (mut file, suffix) = new_staged_upload(&path)?;
let staging_path = staged_upload_path(&path, &suffix);
-
file.write_all(&bytes)
- .context(UnableToCopyDataToFileSnafu)?;
-
- std::fs::rename(staging_path,
path).context(UnableToRenameFileSnafu)?;
-
- Ok(())
+ .context(UnableToCopyDataToFileSnafu)
+ .and_then(|_| {
+ std::fs::rename(&staging_path,
&path).context(UnableToRenameFileSnafu)
Review Comment:
I'm not really sure how best to test this...
##########
object_store/src/local.rs:
##########
@@ -318,7 +322,6 @@ impl ObjectStore for LocalFileSystem {
&self,
location: &Path,
) -> Result<Box<dyn AsyncWrite + Unpin + Send>> {
- #[cfg(not(target_arch = "wasm32"))]
Review Comment:
The entire module is feature gated so this was redundant
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]