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

chore: fix some compiler warnings #3262

Merged
merged 2 commits into from
Feb 25, 2025
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 crates/aws/src/credentials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ impl AWSForObjectStore {
}

/// Return true if a credential has been cached
#[cfg(test)]
async fn has_cached_credentials(&self) -> bool {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is only used in tests it seems

let guard = self.cache.lock().await;
(*guard).is_some()
Expand Down
2 changes: 2 additions & 0 deletions crates/core/src/kernel/models/fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ static REMOVE_FIELD: LazyLock<StructField> = LazyLock::new(|| {
true,
)
});
// TODO implement support for this checkpoint
#[expect(dead_code)]
static REMOVE_FIELD_CHECKPOINT: LazyLock<StructField> = LazyLock::new(|| {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want to keep this around for now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compiler says it is unused. I can fix the compiler warning by adding an #allow(unused)

Can you give me some hint about why we are keeping it around so I can add a comment for the next person?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is part of the checkpoint we still need to support at some point

StructField::new(
"remove",
Expand Down
1 change: 1 addition & 0 deletions crates/core/src/operations/filesystem_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ where
}

// Custom deserialization that parses a JSON string into MetricDetails
#[expect(dead_code)]
fn deserialize_vec_string<'de, D>(deserializer: D) -> Result<Vec<String>, D::Error>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here as well

Copy link
Contributor Author

@alamb alamb Feb 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compiler says it is unused (and the function isn't pub so it can't be called outside this module). I will put it back with an #allow(unused)

Any chance you can give me the rationale to add to the comments for future readers?

where
D: Deserializer<'de>,
Expand Down
1 change: 0 additions & 1 deletion crates/core/src/operations/load_cdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,6 @@ pub(crate) mod tests {
use arrow_array::{Int32Array, RecordBatch, StringArray};
use arrow_schema::Schema;
use chrono::NaiveDateTime;
use datafusion::physical_plan::ExecutionPlan;
use datafusion::prelude::SessionContext;
use datafusion_common::assert_batches_sorted_eq;
use itertools::Itertools;
Expand Down
1 change: 0 additions & 1 deletion crates/core/src/operations/merge/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1573,7 +1573,6 @@ mod tests {
use arrow_schema::DataType as ArrowDataType;
use arrow_schema::Field;
use datafusion::assert_batches_sorted_eq;
use datafusion::physical_plan::ExecutionPlan;
use datafusion::prelude::*;
use datafusion_common::Column;
use datafusion_common::TableReference;
Expand Down
1 change: 0 additions & 1 deletion crates/core/src/operations/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
//! └───────────────────────────────┘
//!</pre>
use std::collections::HashMap;
use std::future::Future;
use std::sync::Arc;

use bytes::Bytes;
Expand Down
1 change: 0 additions & 1 deletion crates/core/src/operations/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,6 @@ mod tests {
use arrow::record_batch::RecordBatch;
use arrow_schema::DataType;
use datafusion::assert_batches_sorted_eq;
use datafusion::physical_plan::ExecutionPlan;
use datafusion::prelude::*;
use serde_json::json;
use std::sync::Arc;
Expand Down
1 change: 0 additions & 1 deletion crates/core/src/operations/write/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,6 @@ mod tests {
use arrow_schema::{DataType, Field, Fields, Schema as ArrowSchema, TimeUnit};
use datafusion::prelude::*;
use datafusion::{assert_batches_eq, assert_batches_sorted_eq};
use datafusion_physical_plan::ExecutionPlan;
use itertools::Itertools;
use serde_json::{json, Value};

Expand Down
7 changes: 2 additions & 5 deletions crates/lakefs/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,11 @@ mod tests {
use maplit::hashmap;
use serial_test::serial;

struct ScopedEnv {
vars: HashMap<std::ffi::OsString, std::ffi::OsString>,
}
struct ScopedEnv {}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the compiler claimed this field was never read -- if the CI passes we could remove the entire structure I think (but I wanted to make the diff smaller to see initially)


impl ScopedEnv {
pub fn new() -> Self {
let vars = std::env::vars_os().collect();
Self { vars }
Self {}
}

pub fn run<T>(mut f: impl FnMut() -> T) -> T {
Expand Down
Loading