From a84061914798f041612f503cb5cedefc62b2ddce Mon Sep 17 00:00:00 2001 From: TennyZhuang Date: Fri, 13 Oct 2023 19:05:27 +0800 Subject: [PATCH 1/4] chore(toolchain): use toml format in feature-store rust-toolchain Signed-off-by: TennyZhuang --- integration_tests/feature-store/simulator/rust-toolchain | 1 + 1 file changed, 1 insertion(+) diff --git a/integration_tests/feature-store/simulator/rust-toolchain b/integration_tests/feature-store/simulator/rust-toolchain index 35bda38a1dcfb..83cff5c64208d 100644 --- a/integration_tests/feature-store/simulator/rust-toolchain +++ b/integration_tests/feature-store/simulator/rust-toolchain @@ -1 +1,2 @@ +[toolchain] nightly-2022-06-20 From 94d44882d6c33f3e1d7f76ca1d6082904a37edca Mon Sep 17 00:00:00 2001 From: TennyZhuang Date: Tue, 17 Oct 2023 17:06:18 +0800 Subject: [PATCH 2/4] valid toml file Signed-off-by: TennyZhuang --- integration_tests/feature-store/simulator/rust-toolchain | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/feature-store/simulator/rust-toolchain b/integration_tests/feature-store/simulator/rust-toolchain index 83cff5c64208d..23dc1c06b6465 100644 --- a/integration_tests/feature-store/simulator/rust-toolchain +++ b/integration_tests/feature-store/simulator/rust-toolchain @@ -1,2 +1,2 @@ [toolchain] -nightly-2022-06-20 +channel = "nightly-2022-06-20" From 577c9897a956d00b68b3c89ef767745eb78cdee0 Mon Sep 17 00:00:00 2001 From: TennyZhuang Date: Tue, 17 Oct 2023 17:07:50 +0800 Subject: [PATCH 3/4] bummp and fix Signed-off-by: TennyZhuang --- integration_tests/feature-store/simulator/Cargo.toml | 3 --- integration_tests/feature-store/simulator/rust-toolchain | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/integration_tests/feature-store/simulator/Cargo.toml b/integration_tests/feature-store/simulator/Cargo.toml index 1fd9609ba2d1a..f0a82f9867ecb 100644 --- a/integration_tests/feature-store/simulator/Cargo.toml +++ b/integration_tests/feature-store/simulator/Cargo.toml @@ -20,6 +20,3 @@ prost = "0.10" serde = { version = "1", features = ["derive"] } futures = "0.3.0" csv = "1.2.2" - -[lints] -workspace = true diff --git a/integration_tests/feature-store/simulator/rust-toolchain b/integration_tests/feature-store/simulator/rust-toolchain index 23dc1c06b6465..ebc0b6c285a4e 100644 --- a/integration_tests/feature-store/simulator/rust-toolchain +++ b/integration_tests/feature-store/simulator/rust-toolchain @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2022-06-20" +channel = "nightly-2023-09-09" From 42d632ffac46042a4ddab16f169cea04bbdcee0a Mon Sep 17 00:00:00 2001 From: TennyZhuang Date: Tue, 17 Oct 2023 17:10:28 +0800 Subject: [PATCH 4/4] fix clippy Signed-off-by: TennyZhuang --- integration_tests/feature-store/simulator/src/entities.rs | 4 ++-- .../feature-store/simulator/src/entities_taxi.rs | 2 +- .../feature-store/simulator/src/simulation.rs | 7 +++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/integration_tests/feature-store/simulator/src/entities.rs b/integration_tests/feature-store/simulator/src/entities.rs index 114a1e5c1ee0f..623bc93434cb2 100644 --- a/integration_tests/feature-store/simulator/src/entities.rs +++ b/integration_tests/feature-store/simulator/src/entities.rs @@ -60,7 +60,7 @@ impl User { Ok(ActionHistory { userid: self.userid.clone(), - changenum: changenum, + changenum, event_type: event_type.to_string(), timestamp, }) @@ -93,5 +93,5 @@ pub fn parse_user_metadata() -> Result, ()> { let users = read_users_json(Path::new(&*generator_path).join("users.json")).unwrap(); - return Ok(users); + Ok(users) } diff --git a/integration_tests/feature-store/simulator/src/entities_taxi.rs b/integration_tests/feature-store/simulator/src/entities_taxi.rs index 8ef9e1f358e4b..b5800f707d0e0 100644 --- a/integration_tests/feature-store/simulator/src/entities_taxi.rs +++ b/integration_tests/feature-store/simulator/src/entities_taxi.rs @@ -101,7 +101,7 @@ impl TaxiFeature { mta_tax: self.mta_tax, tip_amount: self.tip_amount, tolls_amount: self.tolls_amount, - ehail_fee: self.ehail_fee.unwrap_or_else(|| 0.0), + ehail_fee: self.ehail_fee.unwrap_or(0.0), improvement_surcharge: self.improvement_surcharge, total_amount: self.total_amount, payment_type: self.payment_type, diff --git a/integration_tests/feature-store/simulator/src/simulation.rs b/integration_tests/feature-store/simulator/src/simulation.rs index 96f3c31921a5e..5475138d6d697 100644 --- a/integration_tests/feature-store/simulator/src/simulation.rs +++ b/integration_tests/feature-store/simulator/src/simulation.rs @@ -4,7 +4,6 @@ use std::thread::sleep; use std::time::Duration; use futures::future::join_all; -use rand; use rand::Rng; use tokio::sync::Mutex; use tonic::transport::Channel; @@ -15,7 +14,7 @@ use crate::{entities, entities_taxi}; fn get_delay_mills(delay_val: f64) -> u64 { let turbulence = - rand::thread_rng().gen_range((delay_val * 0.6) as f64, (delay_val * 1.1) as f64) as f64; + rand::thread_rng().gen_range(delay_val * 0.6, delay_val * 1.1); (turbulence * 10000.0) as u64 } @@ -33,7 +32,7 @@ pub async fn main_loop(simulator_type: String) { } } -async fn mock_taxi(client: Arc>>) -> () { +async fn mock_taxi(client: Arc>>) { let (offline_features, online_features) = entities_taxi::parse_taxi_metadata(); println!("Write training data len is {:?}", offline_features.len()); let mut threads = vec![]; @@ -87,7 +86,7 @@ async fn mock_taxi(client: Arc>>) -> () { } #[allow(dead_code)] -async fn mock_user_mfa(client: Arc>>) -> () { +async fn mock_user_mfa(client: Arc>>) { let users = entities::parse_user_metadata().unwrap(); let mut threads = vec![]; for user in users {