Skip to content

Commit

Permalink
a few more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik committed Feb 23, 2025
1 parent 13facb8 commit 8184e59
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 32 deletions.
3 changes: 1 addition & 2 deletions crates/core/src/operations/optimize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -709,9 +709,8 @@ impl MergePlan {
})
.map(|(partition, files)| {
debug!(
"merging a group of {} files in partition {:?}",
"merging a group of {} files in partition {partition:?}",
files.len(),
partition,
);
for file in files.iter() {
debug!(" file {}", file.location);
Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/operations/write/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub(crate) async fn write_execution_plan_cdc(
Action::Add(add) => {
Action::Cdc(AddCDCFile {
// This is a gnarly hack, but the action needs the nested path, not the
// path isnide the prefixed store
// path inside the prefixed store
path: format!("_change_data/{}", add.path),
size: add.size,
partition_values: add.partition_values,
Expand Down Expand Up @@ -421,7 +421,7 @@ pub(crate) async fn write_execution_plan_v2(
{
Action::Cdc(AddCDCFile {
// This is a gnarly hack, but the action needs the nested path, not the
// path isnide the prefixed store
// path inside the prefixed store
path: format!("_change_data/{}", add.path),
size: add.size,
partition_values: add.partition_values,
Expand Down
12 changes: 6 additions & 6 deletions crates/core/src/schema/partitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ impl Serialize for PartitionFilter {
S: Serializer,
{
let s = match &self.value {
PartitionValue::Equal(value) => format!("{} = '{}'", self.key, value),
PartitionValue::NotEqual(value) => format!("{} != '{}'", self.key, value),
PartitionValue::GreaterThan(value) => format!("{} > '{}'", self.key, value),
PartitionValue::GreaterThanOrEqual(value) => format!("{} >= '{}'", self.key, value),
PartitionValue::LessThan(value) => format!("{} < '{}'", self.key, value),
PartitionValue::LessThanOrEqual(value) => format!("{} <= '{}'", self.key, value),
PartitionValue::Equal(value) => format!("{} = '{value}'", self.key),
PartitionValue::NotEqual(value) => format!("{} != '{value}'", self.key),
PartitionValue::GreaterThan(value) => format!("{} > '{value}'", self.key),
PartitionValue::GreaterThanOrEqual(value) => format!("{} >= '{value}'", self.key),
PartitionValue::LessThan(value) => format!("{} < '{value}'", self.key),
PartitionValue::LessThanOrEqual(value) => format!("{} <= '{value}'", self.key),
// used upper case for IN and NOT similar to SQL
PartitionValue::In(values) => {
let quoted_values: Vec<String> = values.iter().map(|v| format!("'{v}'")).collect();
Expand Down
2 changes: 1 addition & 1 deletion crates/gcp/tests/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl StorageIntegration for GcpIntegration {
fn copy_directory(&self, source: &str, destination: &str) -> std::io::Result<ExitStatus> {
use futures::executor::block_on;

let to = format!("{}/{}", self.root_uri(), destination);
let to = format!("{}/{destination}", self.root_uri());
let _ = block_on(copy_table(source.to_owned(), None, to, None, true));
Ok(ExitStatus::default())
}
Expand Down
2 changes: 1 addition & 1 deletion crates/hdfs/tests/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl StorageIntegration for HdfsIntegration {
"-copyFromLocal",
"-p",
source,
&format!("{}/{}", self.root_uri(), destination),
&format!("{}/{destination}", self.root_uri()),
])
.status()
.unwrap())
Expand Down
14 changes: 7 additions & 7 deletions crates/lakefs/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl LakeFSClient {
) -> DeltaResult<(Url, String)> {
let (repo, source_branch, table) = self.decompose_url(source_url.to_string());

let request_url = format!("{}/api/v1/repositories/{}/branches", self.config.host, repo);
let request_url = format!("{}/api/v1/repositories/{repo}/branches", self.config.host);

let transaction_branch = format!("delta-tx-{operation_id}");
let body = json!({
Expand Down Expand Up @@ -102,8 +102,8 @@ impl LakeFSClient {
branch: String,
) -> Result<(), TransactionError> {
let request_url = format!(
"{}/api/v1/repositories/{}/branches/{}",
self.config.host, repo, branch
"{}/api/v1/repositories/{repo}/branches/{branch}",
self.config.host,
);
let response = self
.http_client
Expand Down Expand Up @@ -139,8 +139,8 @@ impl LakeFSClient {
allow_empty: bool,
) -> DeltaResult<()> {
let request_url = format!(
"{}/api/v1/repositories/{}/branches/{}/commits",
self.config.host, repo, branch
"{}/api/v1/repositories/{repo}/branches/{branch}/commits",
self.config.host,
);

let body = json!({
Expand Down Expand Up @@ -185,8 +185,8 @@ impl LakeFSClient {
allow_empty: bool,
) -> Result<(), TransactionError> {
let request_url = format!(
"{}/api/v1/repositories/{}/refs/{}/merge/{}",
self.config.host, repo, transaction_branch, target_branch
"{}/api/v1/repositories/{repo}/refs/{transaction_branch}/merge/{target_branch}",
self.config.host,
);

let body = json!({
Expand Down
2 changes: 1 addition & 1 deletion crates/lakefs/tests/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl StorageIntegration for LakeFSIntegration {
fn copy_directory(&self, source: &str, destination: &str) -> std::io::Result<ExitStatus> {
println!(
"Copy directory called with {source} {}",
format!("{}/{}", self.root_uri(), destination)
format!("{}/{destination}", self.root_uri())
);
let lakectl = which("lakectl").expect("Failed to find lakectl executable");

Expand Down
3 changes: 1 addition & 2 deletions crates/mount/tests/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ impl StorageIntegration for DbfsIntegration {
let mut options = CopyOptions::new();
options.content_only = true;
let dest_path = format!(
"/dbfs{}/{}",
"/dbfs{}/{destination}",
self.tmp_dir.as_ref().to_str().unwrap(),
destination
);
std::fs::create_dir_all(&dest_path)?;
copy(source, &dest_path, &options).expect("Failed to copy");
Expand Down
2 changes: 1 addition & 1 deletion crates/test/src/concurrent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl Worker {
async fn commit_sequence(&mut self, n: i64) -> HashMap<i64, String> {
let mut result = HashMap::new();
for i in 0..n {
let name = format!("{}-{}", self.name, i);
let name = format!("{}-{i}", self.name);
let v = self.commit_file(&name).await;
result.insert(v, name);
tokio::time::sleep(Duration::from_millis(100)).await;
Expand Down
4 changes: 2 additions & 2 deletions crates/test/src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ pub async fn read_golden(integration: &IntegrationContext) -> TestResult {
}

async fn verify_store(integration: &IntegrationContext, root_path: &str) -> TestResult {
let table_uri = format!("{}/{}", integration.root_uri(), root_path);
let table_uri = format!("{}/{root_path}", integration.root_uri());

let storage = DeltaTableBuilder::from_uri(table_uri.clone())
.with_allow_http(true)
Expand All @@ -158,7 +158,7 @@ async fn verify_store(integration: &IntegrationContext, root_path: &str) -> Test
}

async fn read_encoded_table(integration: &IntegrationContext, root_path: &str) -> TestResult {
let table_uri = format!("{}/{}", integration.root_uri(), root_path);
let table_uri = format!("{}/{root_path}", integration.root_uri());

let table = DeltaTableBuilder::from_uri(table_uri)
.with_allow_http(true)
Expand Down
6 changes: 2 additions & 4 deletions proofs/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,16 +519,14 @@ impl Model for AtomicRenameSys {

let writer_versions = next_state.writer_versions();
lines.push(format!(
"writer_versions({}): {:?}",
"writer_versions({}): {writer_versions:?}",
writer_versions.len(),
writer_versions,
));

let blob_store_obj_keys = next_state.blob_store_obj_keys();
lines.push(format!(
"blob_store_obj_keys({}): {:?}",
"blob_store_obj_keys({}): {blob_store_obj_keys:?}",
blob_store_obj_keys.len(),
blob_store_obj_keys,
));

lines.join("\n")
Expand Down
4 changes: 1 addition & 3 deletions python/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,15 +497,13 @@ impl Field {
format!(", metadata={metadata_repr}")
};
Ok(format!(
"Field({}, {}, nullable={}{})",
"Field({}, {type_repr}, nullable={}{maybe_metadata})",
self.inner.name(),
type_repr,
if self.inner.is_nullable() {
"True"
} else {
"False"
},
maybe_metadata,
))
}

Expand Down

0 comments on commit 8184e59

Please sign in to comment.