Skip to content

Commit

Permalink
c
Browse files Browse the repository at this point in the history
  • Loading branch information
nameexhaustion committed Jun 26, 2024
1 parent 027affc commit c57de81
Showing 1 changed file with 8 additions and 37 deletions.
45 changes: 8 additions & 37 deletions crates/polars-lazy/src/scan/file_list_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,14 @@ fn expand_paths(
}
};

if is_cloud || config::force_async() {
if is_cloud || { cfg!(not(target_family = "windows")) && config::force_async() } {
#[cfg(feature = "async")]
{
let format_path = |scheme: &str, bucket: &str, location: &str| {
if is_cloud {
format!("{}://{}/{}", scheme, bucket, location)
} else {
// This was FORCE_ASYNC but some readers don't support cloud paths.
#[cfg(not(target_family = "windows"))]
{
format!("/{}", location)
}
#[cfg(target_family = "windows")]
{
location.to_string()
}
format!("/{}", location)
}
};

Expand Down Expand Up @@ -118,18 +110,11 @@ fn expand_paths(
.map(|x| {
x.map(|x| {
PathBuf::from({
#[cfg(not(target_family = "windows"))]
{
format_path(
&cloud_location.scheme,
&cloud_location.bucket,
x.location.as_ref(),
)
}
#[cfg(target_family = "windows")]
{
x.location.to_string()
}
format_path(
&cloud_location.scheme,
&cloud_location.bucket,
x.location.as_ref(),
)
})
})
})
Expand Down Expand Up @@ -176,21 +161,7 @@ fn expand_paths(
out_paths.extend(iter.into_iter().map(PathBuf::from));
} else {
// FORCE_ASYNC, remove leading file:// as not all readers support it.
out_paths.extend(
iter.iter()
.map(|x| {
#[cfg(not(target_family = "windows"))]
{
&x[7..]
}
#[cfg(target_family = "windows")]
{
// "file:///C:/"
&x[8..]
}
})
.map(PathBuf::from),
)
out_paths.extend(iter.iter().map(|x| &x[7..]).map(PathBuf::from))
}
}
}
Expand Down

0 comments on commit c57de81

Please sign in to comment.