Skip to content
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
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
12 changes: 6 additions & 6 deletions influxdb3_catalog/src/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4524,7 +4524,7 @@ mod tests {

let table_ids = vec![TableId::from(1), TableId::from(2), TableId::from(3)];
for (i, table_id) in table_ids.iter().enumerate() {
let table_name = Arc::from(format!("table_{}", i));
let table_name = Arc::from(format!("table_{i}"));
let table_def = TableDefinition::new_empty(*table_id, table_name);
db_schema
.tables
Expand Down Expand Up @@ -4902,7 +4902,7 @@ mod tests {
assert!(duration >= Duration::from_secs(3599));
assert!(duration <= Duration::from_secs(3601));
}
other => panic!("Expected Hard deletion status, got {:?}", other),
other => panic!("Expected Hard deletion status, got {other:?}"),
}
}

Expand Down Expand Up @@ -4948,7 +4948,7 @@ mod tests {
assert!(duration >= Duration::from_secs(599));
assert!(duration <= Duration::from_secs(601));
}
other => panic!("Expected Hard deletion status, got {:?}", other),
other => panic!("Expected Hard deletion status, got {other:?}"),
}
}

Expand Down Expand Up @@ -5092,7 +5092,7 @@ mod tests {
assert!(duration >= Duration::from_secs(3599));
assert!(duration <= Duration::from_secs(3601));
}
other => panic!("Expected Hard deletion status, got {:?}", other),
other => panic!("Expected Hard deletion status, got {other:?}"),
}
}

Expand Down Expand Up @@ -5159,7 +5159,7 @@ mod tests {
assert!(duration >= Duration::from_secs(599));
assert!(duration <= Duration::from_secs(601));
}
other => panic!("Expected Hard deletion status, got {:?}", other),
other => panic!("Expected Hard deletion status, got {other:?}"),
}
}

Expand Down Expand Up @@ -5263,7 +5263,7 @@ mod tests {
assert!(duration >= Duration::from_secs(1799));
assert!(duration <= Duration::from_secs(1801));
}
other => panic!("Expected Hard deletion status for table3, got {:?}", other),
other => panic!("Expected Hard deletion status for table3, got {other:?}"),
}
}
}
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
Loading