Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 4 additions & 4 deletions influxdb3/src/commands/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ pub async fn command(config: Config) -> Result<(), Box<dyn Error>> {
let json = json!({"token": response.token, "help_msg": help_msg});
let stringified = serde_json::to_string_pretty(&json)
.expect("token details to be parseable");
println!("{}", stringified);
println!("{stringified}");
}
token::TokenOutputFormat::Text => {
let token = response.token;
Expand All @@ -419,7 +419,7 @@ pub async fn command(config: Config) -> Result<(), Box<dyn Error>> {
}
},
Err(err) => {
println!("Failed to create token, error: {:?}", err);
println!("Failed to create token, error: {err:?}");
}
}
}
Expand Down Expand Up @@ -458,10 +458,10 @@ pub async fn command(config: Config) -> Result<(), Box<dyn Error>> {
.await
{
Err(e) => {
eprintln!("Failed to create trigger: {}", e);
eprintln!("Failed to create trigger: {e}");
return Err(e.into());
}
Ok(_) => println!("Trigger {} created successfully", trigger_name),
Ok(_) => println!("Trigger {trigger_name} created successfully"),
}
}
}
Expand Down
14 changes: 4 additions & 10 deletions influxdb3/src/commands/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,7 @@ pub async fn command(config: Config) -> Result<(), Box<dyn Error>> {
hard_delete,
..
}) => {
println!(
"Are you sure you want to delete {:?}? Enter 'yes' to confirm",
database_name
);
println!("Are you sure you want to delete {database_name:?}? Enter 'yes' to confirm");
let mut confirmation = String::new();
let _ = io::stdin().read_line(&mut confirmation);
if confirmation.trim() != "yes" {
Expand Down Expand Up @@ -341,7 +338,7 @@ pub async fn command(config: Config) -> Result<(), Box<dyn Error>> {
force,
)
.await?;
println!("Trigger {} deleted successfully", trigger_name);
println!("Trigger {trigger_name} deleted successfully");
}
SubCommand::Token(TokenConfig { token_name, .. }) => {
if token_name == "_admin" {
Expand All @@ -351,17 +348,14 @@ pub async fn command(config: Config) -> Result<(), Box<dyn Error>> {
return Ok(());
}

println!(
"Are you sure you want to delete {:?}? Enter 'yes' to confirm",
token_name
);
println!("Are you sure you want to delete {token_name:?}? Enter 'yes' to confirm");
let mut confirmation = String::new();
let _ = io::stdin().read_line(&mut confirmation);
if confirmation.trim() != "yes" {
println!("Cannot delete token without confirmation");
} else {
client.api_v3_configure_token_delete(&token_name).await?;
println!("Token {:?} deleted successfully", &token_name);
println!("Token {token_name:?} deleted successfully");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion influxdb3/src/commands/disable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub async fn command(config: Config) -> Result<(), Box<dyn Error>> {
client
.api_v3_configure_processing_engine_trigger_disable(database_name, &trigger_name)
.await?;
println!("Trigger {} disabled successfully", trigger_name);
println!("Trigger {trigger_name} disabled successfully");
}
}
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion influxdb3/src/commands/enable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub async fn command(config: Config) -> Result<(), Box<dyn Error>> {
client
.api_v3_configure_processing_engine_trigger_enable(database_name, &trigger_name)
.await?;
println!("Trigger {} enabled successfully", trigger_name);
println!("Trigger {trigger_name} enabled successfully");
}
}
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion influxdb3/src/commands/plugin_test/wal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub(super) async fn command(config: Config) -> Result<(), Box<dyn Error>> {
.expect("serialize wal plugin test response as JSON");

// pretty print the response
println!("{}", res);
println!("{res}");

Ok(())
}
2 changes: 1 addition & 1 deletion influxdb3/src/commands/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ async fn setup_telemetry_store(
let influxdb_pkg_version = env!("CARGO_PKG_VERSION");
let influxdb_pkg_name = env!("CARGO_PKG_NAME");
// Following should show influxdb3-0.1.0
let influx_version = format!("{}-{}", influxdb_pkg_name, influxdb_pkg_version);
let influx_version = format!("{influxdb_pkg_name}-{influxdb_pkg_version}");
let obj_store_type = object_store_config
.object_store
.unwrap_or(ObjectStoreType::Memory);
Expand Down
2 changes: 1 addition & 1 deletion influxdb3/src/commands/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub async fn command(config: Config) -> Result<(), Box<dyn Error>> {
.api_v3_configure_db_update(&database_name, retention)
.await?;

println!("Database \"{}\" updated successfully", database_name);
println!("Database \"{database_name}\" updated successfully");
} else {
return Err("--retention-period is required for update database".into());
}
Expand Down
2 changes: 1 addition & 1 deletion influxdb3/tests/cli/admin_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async fn test_create_admin_token() {
let result = server
.run(vec!["create", "token", "--admin"], args)
.unwrap();
println!("{:?}", result);
println!("{result:?}");
assert_contains!(&result, "New token created successfully!");
}

Expand Down
2 changes: 1 addition & 1 deletion influxdb3/tests/cli/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ impl CreateTableQuery<'_> {
let fields_arg = self
.fields
.iter()
.map(|(name, dt)| format!("{}:{}", name, dt))
.map(|(name, dt)| format!("{name}:{dt}"))
.collect::<Vec<_>>()
.join(",");

Expand Down
12 changes: 6 additions & 6 deletions influxdb3/tests/cli/db_retention.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ async fn test_update_db_retention_period() {

assert_contains!(
&result,
format!("Database \"{}\" created successfully", db_name)
format!("Database \"{db_name}\" created successfully")
);

// Update database retention period
Expand All @@ -141,7 +141,7 @@ async fn test_update_db_retention_period() {

assert_contains!(
&result,
format!("Database \"{}\" updated successfully", db_name)
format!("Database \"{db_name}\" updated successfully")
);

// Verify the updated retention period
Expand All @@ -158,7 +158,7 @@ async fn test_update_db_retention_period() {
"query",
"-d",
"_internal",
&format!("SELECT retention_period_ns FROM system.databases WHERE system.databases.database_name='{}'", db_name),
&format!("SELECT retention_period_ns FROM system.databases WHERE system.databases.database_name='{db_name}'"),
],
args,
)
Expand All @@ -183,7 +183,7 @@ async fn test_clear_db_retention_period() {

assert_contains!(
&result,
format!("Database \"{}\" created successfully", db_name)
format!("Database \"{db_name}\" created successfully")
);

// Clear database retention period (set to none)
Expand All @@ -203,7 +203,7 @@ async fn test_clear_db_retention_period() {

assert_contains!(
&result,
format!("Database \"{}\" updated successfully", db_name)
format!("Database \"{db_name}\" updated successfully")
);

// Verify the retention period is now none (cleared)
Expand All @@ -220,7 +220,7 @@ async fn test_clear_db_retention_period() {
"query",
"-d",
"_internal",
&format!("SELECT retention_period_ns FROM system.databases WHERE system.databases.database_name='{}'", db_name),
&format!("SELECT retention_period_ns FROM system.databases WHERE system.databases.database_name='{db_name}'"),
],
args,
)
Expand Down
22 changes: 7 additions & 15 deletions influxdb3/tests/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fn write_plugin_to_temp_dir(temp_dir: &TempDir, name: &str, code: &str) -> PathB

// Write the code to the file
let mut file = File::create(&file_path).unwrap();
writeln!(file, "{}", code).unwrap();
writeln!(file, "{code}").unwrap();
file_path
}

Expand Down Expand Up @@ -628,16 +628,13 @@ async fn test_create_trigger_and_run() {
}
check_count += 1;
if check_count > 10 {
panic!(
"Unexpected query result, got: {:#?}, expected {:#?}",
value, expected
);
panic!("Unexpected query result, got: {value:#?}, expected {expected:#?}");
}
}
Err(e) => {
check_count += 1;
if check_count > 10 {
panic!("Failed to query processed data: {}", e);
panic!("Failed to query processed data: {e}");
}
tokio::time::sleep(tokio::time::Duration::from_millis(10)).await;
}
Expand Down Expand Up @@ -722,16 +719,13 @@ async fn test_triggers_are_started() {
}
check_count += 1;
if check_count > 10 {
panic!(
"Unexpected query result, got: {:#?}, expected {:#?}",
value, expected
);
panic!("Unexpected query result, got: {value:#?}, expected {expected:#?}");
}
}
Err(e) => {
check_count += 1;
if check_count > 10 {
panic!("Failed to query processed data: {}", e);
panic!("Failed to query processed data: {e}");
}
tokio::time::sleep(tokio::time::Duration::from_millis(10)).await;
}
Expand Down Expand Up @@ -894,7 +888,7 @@ def process_writes(influxdb3_local, table_batches, args=None):
db_name,
trigger_name,
plugin_filename,
format!("table:{}", table_name),
format!("table:{table_name}"),
)
.run()
.unwrap();
Expand Down Expand Up @@ -2165,9 +2159,7 @@ async fn test_trigger_create_validates_file_present() {
fn check_logs(response: &Value, expected_logs: &[&str]) {
assert!(
response["errors"].as_array().unwrap().is_empty(),
"Unexpected errors in response {:#?}, expected logs {:#?}",
response,
expected_logs
"Unexpected errors in response {response:#?}, expected logs {expected_logs:#?}"
);
let logs = response["log_lines"].as_array().unwrap();
assert_eq!(
Expand Down
2 changes: 1 addition & 1 deletion influxdb3/tests/server/limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async fn limits() -> Result<(), Error> {
let mut lp_500 = String::from("cpu,host=foo,region=bar usage=2");
let mut lp_501 = String::from("cpu,host=foo,region=bar usage=2");
for i in 5..=500 {
let column = format!(",column{}=1", i);
let column = format!(",column{i}=1");
lp_500.push_str(&column);
lp_501.push_str(&column);
}
Expand Down
6 changes: 3 additions & 3 deletions influxdb3/tests/server/packages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ async fn test_python_venv_pip_install() -> Result<()> {
// Install specific version
server
.install_package()
.add_package(format!("{}=={}", TEST_PACKAGE, TEST_VERSION))
.add_package(format!("{TEST_PACKAGE}=={TEST_VERSION}"))
.run()?;

// Verify correct version installed
Expand Down Expand Up @@ -169,7 +169,7 @@ async fn test_venv_requirements_install() -> Result<()> {

// Create requirements.txt
let mut requirements_file = NamedTempFile::new()?;
writeln!(requirements_file, "{}=={}", TEST_PACKAGE, TEST_VERSION)?;
writeln!(requirements_file, "{TEST_PACKAGE}=={TEST_VERSION}")?;

// Install from requirements
server
Expand Down Expand Up @@ -238,7 +238,7 @@ async fn test_auto_venv_pip_install() -> Result<()> {
// Install specific version
server
.install_package()
.add_package(format!("{}=={}", TEST_PACKAGE, TEST_VERSION))
.add_package(format!("{TEST_PACKAGE}=={TEST_VERSION}"))
.with_package_manager("pip")
.run()?;

Expand Down
6 changes: 3 additions & 3 deletions influxdb3_catalog/src/log/versions/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -807,17 +807,17 @@ impl TriggerSpecificationDefinition {
pub fn string_rep(&self) -> String {
match self {
TriggerSpecificationDefinition::SingleTableWalWrite { table_name } => {
format!("table:{}", table_name)
format!("table:{table_name}")
}
TriggerSpecificationDefinition::AllTablesWalWrite => "all_tables".to_string(),
TriggerSpecificationDefinition::Schedule { schedule } => {
format!("cron:{}", schedule)
format!("cron:{schedule}")
}
TriggerSpecificationDefinition::Every { duration } => {
format!("every:{}", format_duration(*duration))
}
TriggerSpecificationDefinition::RequestPath { path } => {
format!("request:{}", path)
format!("request:{path}")
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions influxdb3_catalog/src/log/versions/v3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -886,17 +886,17 @@ impl TriggerSpecificationDefinition {
pub fn string_rep(&self) -> String {
match self {
TriggerSpecificationDefinition::SingleTableWalWrite { table_name } => {
format!("table:{}", table_name)
format!("table:{table_name}")
}
TriggerSpecificationDefinition::AllTablesWalWrite => "all_tables".to_string(),
TriggerSpecificationDefinition::Schedule { schedule } => {
format!("cron:{}", schedule)
format!("cron:{schedule}")
}
TriggerSpecificationDefinition::Every { duration } => {
format!("every:{}", format_duration(*duration))
}
TriggerSpecificationDefinition::RequestPath { path } => {
format!("request:{}", path)
format!("request:{path}")
}
}
}
Expand Down
8 changes: 5 additions & 3 deletions influxdb3_process/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ use std::process::Command;
fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("cargo:rerun-if-env-changed=GIT_HASH");
// Populate env!(GIT_HASH) with the current git commit
println!("cargo:rustc-env=GIT_HASH={}", get_git_hash());
let git_hash = get_git_hash();
println!("cargo:rustc-env=GIT_HASH={git_hash}");
// Populate env!(GIT_HASH_SHORT) with the current git commit
println!("cargo:rustc-env=GIT_HASH_SHORT={}", get_git_hash_short());
let git_hash_short = get_git_hash_short();
println!("cargo:rustc-env=GIT_HASH_SHORT={git_hash_short}");

let path = std::env::var("CARGO_MANIFEST_DIR").unwrap();
let meta = MetadataCommand::new()
Expand All @@ -24,7 +26,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.as_str()
.unwrap_or("Core");
println!("cargo:rerun-if-env-changed=INFLUXDB3_BUILD_VERSION");
println!("cargo:rustc-env=INFLUXDB3_BUILD_VERSION={}", build);
println!("cargo:rustc-env=INFLUXDB3_BUILD_VERSION={build}");

Ok(())
}
Expand Down
5 changes: 2 additions & 3 deletions influxdb3_processing_engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,7 @@ impl ProcessingEngineManagerImpl {
if name.starts_with("gh:") {
let plugin_path = name.strip_prefix("gh:").unwrap();
let url = format!(
"https://raw.githubusercontent.com/influxdata/influxdb3_plugins/main/{}",
plugin_path
"https://raw.githubusercontent.com/influxdata/influxdb3_plugins/main/{plugin_path}"
);
let resp = reqwest::get(&url)
.await
Expand Down Expand Up @@ -1032,7 +1031,7 @@ mod tests {
def process_writes(influxdb3_local, table_batches, args=None):
influxdb3_local.info("done")
"#;
writeln!(file, "{}", code).unwrap();
writeln!(file, "{code}").unwrap();
let environment_manager = ProcessingEngineEnvironmentManager {
plugin_dir: Some(file.path().parent().unwrap().to_path_buf()),
virtual_env_location: None,
Expand Down
Loading