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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Feb 24, 2025

Description

chore: fix compiler warnings

While working on #3261 I found several items that generated warnings locally for me:

For example:

/Users/andrewlamb/.cargo/bin/cargo test --color=always --workspace --profile test --no-fail-fast --config env.RUSTC_BOOTSTRAP=\"1\" -- --format=json -Z unstable-options --show-output
Testing started at 2:41 PM ...
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /Users/andrewlamb/Software/delta-rs/python/Cargo.toml
workspace: /Users/andrewlamb/Software/delta-rs/Cargo.toml
warning: unused import: `std::future::Future`
  --> crates/core/src/operations/transaction/mod.rs:77:5
   |
77 | use std::future::Future;
   |     ^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

I looked at the CI tests and they seem to be passing, so I am not sure why this fails locally for me

Related Issue(s)

Documentation

@@ -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

@github-actions github-actions bot added the binding/rust Issues for the Rust crate label Feb 24, 2025
Copy link

ACTION NEEDED

delta-rs follows the Conventional Commits specification for release automation.

The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification.

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)

@alamb alamb force-pushed the alamb/fix_warnings2 branch from 811f579 to 2d8043f Compare February 24, 2025 20:59
@alamb
Copy link
Contributor Author

alamb commented Feb 24, 2025

I will make another follow on PR for clippy errors I am seeing locally if this one passes

Copy link

codecov bot commented Feb 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.21%. Comparing base (bc09ff3) to head (f7a6d69).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3262   +/-   ##
=======================================
  Coverage   72.20%   72.21%           
=======================================
  Files         143      143           
  Lines       45607    45610    +3     
  Branches    45607    45610    +3     
=======================================
+ Hits        32932    32938    +6     
- Misses      10591    10598    +7     
+ Partials     2084     2074   -10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alamb alamb changed the title chore: Fix some compiler warnings chore: fix some compiler warnings Feb 24, 2025
@alamb alamb force-pushed the alamb/fix_warnings2 branch from 2d8043f to f7a6d69 Compare February 24, 2025 21:50
@@ -145,17 +145,6 @@ static REMOVE_FIELD: LazyLock<StructField> = LazyLock::new(|| {
true,
)
});
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

@@ -79,15 +79,6 @@ where
serializer.serialize_str(&json_string)
}

// Custom deserialization that parses a JSON string into MetricDetails
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?

@alamb alamb force-pushed the alamb/fix_warnings2 branch from 2e0fd8e to 2dc030f Compare February 25, 2025 13:34
@alamb
Copy link
Contributor Author

alamb commented Feb 25, 2025

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binding/rust Issues for the Rust crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants