From 4746a28555acead90b2a8a62579148130b1ea95b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Lizardo?= Date: Mon, 12 Aug 2024 11:50:48 +0200 Subject: [PATCH 1/3] Fix match-case --- src/datafusion/parser.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/datafusion/parser.rs b/src/datafusion/parser.rs index 09c903a8..1c893ec8 100644 --- a/src/datafusion/parser.rs +++ b/src/datafusion/parser.rs @@ -297,13 +297,9 @@ impl<'a> DFParser<'a> { Token::SingleQuotedString(s) => Ok(Value::SingleQuotedString(s)), Token::DoubleQuotedString(s) => Ok(Value::DoubleQuotedString(s)), Token::EscapedStringLiteral(s) => Ok(Value::EscapedStringLiteral(s)), - Token::Number(ref n, l) => match n.parse() { - Ok(n) => Ok(Value::Number(n, l)), - // The tokenizer should have ensured `n` is an integer - // so this should not be possible - Err(e) => parser_err!(format!( - "Unexpected error: could not parse '{n}' as number: {e}" - )), + Token::Number(ref n, l) => { + let n = n.parse().expect("Token::Number should always contain a valid number"); + Ok(Value::Number(n, l)) }, _ => self.parser.expected("string or numeric value", next_token), } From 43be317bd816eac1ed21e3590ccc2d4f7ac78307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Lizardo?= Date: Mon, 12 Aug 2024 11:54:36 +0200 Subject: [PATCH 2/3] Fix formating --- src/datafusion/parser.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/datafusion/parser.rs b/src/datafusion/parser.rs index 1c893ec8..9e9ee31f 100644 --- a/src/datafusion/parser.rs +++ b/src/datafusion/parser.rs @@ -298,9 +298,11 @@ impl<'a> DFParser<'a> { Token::DoubleQuotedString(s) => Ok(Value::DoubleQuotedString(s)), Token::EscapedStringLiteral(s) => Ok(Value::EscapedStringLiteral(s)), Token::Number(ref n, l) => { - let n = n.parse().expect("Token::Number should always contain a valid number"); + let n = n + .parse() + .expect("Token::Number should always contain a valid number"); Ok(Value::Number(n, l)) - }, + } _ => self.parser.expected("string or numeric value", next_token), } } From b45ce5fc2f9ea66c0f39849ddd66305bf3cac910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Lizardo?= Date: Mon, 12 Aug 2024 12:50:12 +0200 Subject: [PATCH 3/3] Remove bucket from options --- object_store_factory/src/aws.rs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/object_store_factory/src/aws.rs b/object_store_factory/src/aws.rs index f18040a2..43283af1 100644 --- a/object_store_factory/src/aws.rs +++ b/object_store_factory/src/aws.rs @@ -120,10 +120,6 @@ impl S3Config { endpoint.clone(), ); } - map.insert( - AmazonS3ConfigKey::Bucket.as_ref().to_string(), - self.bucket.clone(), - ); map.insert( AmazonS3ConfigKey::Client(ClientConfigKey::AllowHttp) .as_ref() @@ -535,10 +531,6 @@ mod tests { hashmap.get(AmazonS3ConfigKey::Endpoint.as_ref()), Some(&"https://s3.amazonaws.com".to_string()) ); - assert_eq!( - hashmap.get(AmazonS3ConfigKey::Bucket.as_ref()), - Some(&"my_bucket".to_string()) - ); assert_eq!( hashmap.get(AmazonS3ConfigKey::Client(ClientConfigKey::AllowHttp).as_ref()), Some(&"true".to_string()) @@ -573,10 +565,6 @@ mod tests { ); assert_eq!(hashmap.get(AmazonS3ConfigKey::Token.as_ref()), None); assert_eq!(hashmap.get(AmazonS3ConfigKey::Endpoint.as_ref()), None); - assert_eq!( - hashmap.get(AmazonS3ConfigKey::Bucket.as_ref()), - Some(&"my_bucket".to_string()) - ); assert_eq!( hashmap.get(AmazonS3ConfigKey::Client(ClientConfigKey::AllowHttp).as_ref()), Some(&"true".to_string())