Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions crates/polars-io/src/cloud/adaptors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ impl BlockingCloudWriter {
/// Wrapper around `BlockingCloudWriter::new_with_object_store` that is useful if you only have a single write task.
/// TODO: Naming?
pub async fn new(uri: &str, cloud_options: Option<&CloudOptions>) -> PolarsResult<Self> {
if let Some(local_path) = uri.strip_prefix("file://") {
// Local paths must be created first, otherwise object store will not write anything.
if !matches!(std::fs::exists(local_path), Ok(true)) {
panic!("[BlockingCloudWriter] Expected local file to be created: {local_path}");
}
}

let (cloud_location, object_store) =
crate::cloud::build_object_store(uri, cloud_options, false).await?;
Self::new_with_object_store(
Expand Down
7 changes: 1 addition & 6 deletions crates/polars-io/src/utils/file.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::io;
use std::ops::{Deref, DerefMut};
use std::path::Path;

#[cfg(feature = "cloud")]
pub use async_writeable::AsyncWriteable;
Expand All @@ -9,7 +8,7 @@ use polars_error::{PolarsError, PolarsResult, feature_gated};
use polars_utils::create_file;
use polars_utils::file::{ClosableFile, WriteClose};
use polars_utils::mmap::ensure_not_mapped;
use polars_utils::plpath::{CloudScheme, PlPathRef};
use polars_utils::plpath::PlPathRef;

use super::sync_on_close::SyncOnCloseType;
use crate::cloud::CloudOptions;
Expand Down Expand Up @@ -71,10 +70,6 @@ impl Writeable {
eprintln!("Writeable: try_new: cloud: {p}")
}

if p.scheme() == CloudScheme::File {
create_file(Path::new(p.strip_scheme()))?;
}

let writer = crate::pl_async::get_runtime().block_in_place_on(
BlockingCloudWriter::new(&p.to_string(), cloud_options),
)?;
Expand Down
Loading