chore: code styling (#1137)

Co-authored-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
Weny Xu
2023-03-08 16:10:12 +08:00
committed by GitHub
parent 3e0fb7e75b
commit ed8252157a
3 changed files with 12 additions and 20 deletions

1
Cargo.lock generated
View File

@@ -2272,7 +2272,6 @@ dependencies = [
"futures-util",
"humantime-serde",
"hyper",
"lazy_static",
"log-store",
"meta-client",
"meta-srv",

View File

@@ -9,6 +9,7 @@ default = ["python"]
python = ["dep:script"]
[dependencies]
async-compat = "0.2"
async-stream.workspace = true
async-trait.workspace = true
api = { path = "../api" }
@@ -44,6 +45,7 @@ object-store = { path = "../object-store" }
pin-project = "1.0"
prost.workspace = true
query = { path = "../query" }
regex = "1.6"
script = { path = "../script", features = ["python"], optional = true }
serde = "1.0"
serde_json = "1.0"
@@ -61,9 +63,6 @@ tokio-stream = { version = "0.1", features = ["net"] }
tonic.workspace = true
tower = { version = "0.4", features = ["full"] }
tower-http = { version = "0.3", features = ["full"] }
regex = "1.6"
lazy_static = "1.4"
async-compat = "0.2"
url = "2.3.1"
[dev-dependencies]

View File

@@ -22,7 +22,6 @@ use datatypes::arrow::record_batch::RecordBatch;
use datatypes::vectors::{Helper, VectorRef};
use futures::future;
use futures_util::TryStreamExt;
use lazy_static::lazy_static;
use object_store::services::{Fs, S3};
use object_store::{Object, ObjectStore, ObjectStoreBuilder};
use regex::Regex;
@@ -35,10 +34,6 @@ use url::{ParseError, Url};
use crate::error::{self, Result};
use crate::sql::SqlHandler;
lazy_static! {
static ref SCHEMA_PATTERN: Regex = Regex::new(r"^\w*://").unwrap();
}
const S3_SCHEMA: &str = "S3";
const ENDPOINT_URL: &str = "ENDPOINT_URL";
const ACCESS_KEY_ID: &str = "ACCESS_KEY_ID";
@@ -223,18 +218,17 @@ impl DataSource {
}
if let Some(enable_str) = connection.get(ENABLE_VIRTUAL_HOST_STYLE) {
let enable = enable_str.as_str().parse::<bool>();
match enable {
Ok(true) => {
builder.enable_virtual_host_style();
let enable = enable_str.as_str().parse::<bool>().map_err(|e| {
error::InvalidConnectionSnafu {
msg: format!(
"failed to parse the option {}={}, {}",
ENABLE_VIRTUAL_HOST_STYLE, enable_str, e
),
}
Err(_) => {
return Err(error::Error::InvalidConnection {
msg: format!("failed to parse the {}", ENABLE_VIRTUAL_HOST_STYLE),
})
}
_ => (),
.build()
})?;
if enable {
builder.enable_virtual_host_style();
}
}