Skip to content

Commit

Permalink
fix: use list to determine if delta location
Browse files Browse the repository at this point in the history
  • Loading branch information
roeap committed Oct 19, 2022
1 parent 7cfcf5b commit cb6e214
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions rust/src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,16 @@ impl DeltaObjectStore {

/// Check if the location is a delta table location
pub async fn is_delta_table_location(&self) -> ObjectStoreResult<bool> {
match self.head(self.log_path()).await {
Ok(_) => Ok(true),
Err(ObjectStoreError::NotFound { .. }) => Ok(false),
Err(err) => Err(err),
// TODO We should really be using HEAD here, but this fails in windows tests
let mut stream = self.list(Some(self.log_path())).await?;
if let Some(res) = stream.next().await {
match res {
Ok(_) => Ok(true),
Err(ObjectStoreError::NotFound { .. }) => Ok(false),
Err(err) => Err(err),
}
} else {
Ok(false)
}
}
}
Expand Down

0 comments on commit cb6e214

Please sign in to comment.