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(toolchain): use toml format in feature-store rust-toolchain #12842

Closed
wants to merge 5 commits into from
Closed
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
3 changes: 0 additions & 3 deletions integration_tests/feature-store/simulator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,3 @@ prost = "0.10"
serde = { version = "1", features = ["derive"] }
futures = "0.3.0"
csv = "1.2.2"

[lints]
workspace = true
3 changes: 2 additions & 1 deletion integration_tests/feature-store/simulator/rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
nightly-2022-06-20
[toolchain]
channel = "nightly-2023-09-09"
4 changes: 2 additions & 2 deletions integration_tests/feature-store/simulator/src/entities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl User {

Ok(ActionHistory {
userid: self.userid.clone(),
changenum: changenum,
changenum,
event_type: event_type.to_string(),
timestamp,
})
Expand Down Expand Up @@ -93,5 +93,5 @@ pub fn parse_user_metadata() -> Result<Vec<User>, ()> {

let users = read_users_json(Path::new(&*generator_path).join("users.json")).unwrap();

return Ok(users);
Ok(users)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 3 additions & 4 deletions integration_tests/feature-store/simulator/src/simulation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
}

Expand All @@ -33,7 +32,7 @@ pub async fn main_loop(simulator_type: String) {
}
}

async fn mock_taxi(client: Arc<Mutex<ServerClient<Channel>>>) -> () {
async fn mock_taxi(client: Arc<Mutex<ServerClient<Channel>>>) {
let (offline_features, online_features) = entities_taxi::parse_taxi_metadata();
println!("Write training data len is {:?}", offline_features.len());
let mut threads = vec![];
Expand Down Expand Up @@ -87,7 +86,7 @@ async fn mock_taxi(client: Arc<Mutex<ServerClient<Channel>>>) -> () {
}

#[allow(dead_code)]
async fn mock_user_mfa(client: Arc<Mutex<ServerClient<Channel>>>) -> () {
async fn mock_user_mfa(client: Arc<Mutex<ServerClient<Channel>>>) {
let users = entities::parse_user_metadata().unwrap();
let mut threads = vec![];
for user in users {
Expand Down
Loading