Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(python, rust): use url encoder when encoding partition values #2705

Merged
merged 1 commit into from
Jul 25, 2024
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
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ tracing = { version = "0.1", features = ["log"] }
regex = { version = "1" }
thiserror = { version = "1" }
url = { version = "2" }
urlencoding = "2.1.3"
uuid = { version = "1" }

# runtime / async
Expand Down
1 change: 1 addition & 0 deletions crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ regex = { workspace = true }
thiserror = { workspace = true }
uuid = { workspace = true, features = ["serde", "v4"] }
url = { workspace = true }
urlencoding = { workspace = true}

# runtime
async-trait = { workspace = true }
Expand Down
6 changes: 3 additions & 3 deletions crates/core/src/kernel/scalars.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//! Auxiliary methods for dealing with kernel scalars
//!
use std::cmp::Ordering;

use arrow_array::Array;
use arrow_schema::TimeUnit;
use chrono::{DateTime, TimeZone, Utc};
Expand All @@ -10,6 +8,8 @@ use delta_kernel::{
schema::StructField,
};
use object_store::path::Path;
use std::cmp::Ordering;
use urlencoding::encode;

use crate::NULL_PARTITION_VALUE_DATA_PATH;

Expand Down Expand Up @@ -76,7 +76,7 @@ impl ScalarExt for Scalar {
if self.is_null() {
return NULL_PARTITION_VALUE_DATA_PATH.to_string();
}
Path::from(self.serialize()).to_string()
encode(Path::from(self.serialize()).as_ref()).to_string()
}

/// Create a [`Scalar`] form a row in an arrow array.
Expand Down
Loading