Skip to content

Commit

Permalink
perf: Remove async directory auto-detection (pola-rs#17779)
Browse files Browse the repository at this point in the history
  • Loading branch information
nameexhaustion authored Jul 22, 2024
1 parent 26346cf commit 2eb1ac2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions crates/polars-io/src/path_utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,13 @@ pub fn expand_paths_hive(

let prefix = object_path_from_string(cloud_location.prefix.clone())?;

let out = if !path.ends_with("/")
&& cloud_location.expansion.is_none()
&& store.head(&prefix).await.is_ok()
{
let out = if !path.ends_with("/") && cloud_location.expansion.is_none() && {
// We need to check if it is a directory for local paths (we can be here due
// to FORCE_ASYNC). For cloud paths the convention is that the user must add
// a trailing slash `/` to scan directories. We don't infer it as that would
// mean sending one network request per path serially (very slow).
is_cloud || PathBuf::from(path).is_file()
} {
(
0,
vec![PathBuf::from(format_path(
Expand Down

0 comments on commit 2eb1ac2

Please sign in to comment.