Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrebnov committed Sep 24, 2024
1 parent d77e97b commit 241e4bf
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions snowflake-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ impl RawQueryResult {
.collect::<Vec<Result<RecordBatch, ArrowError>>>()
.await;

return Ok(QueryResult::Arrow(
Ok(QueryResult::Arrow(
arrow_records.into_iter().map(Result::unwrap).collect(),
));
))
}
RawQueryResult::Json(j) => Ok(QueryResult::Json(j)),
RawQueryResult::Empty => Ok(QueryResult::Empty),
Expand All @@ -201,12 +201,11 @@ impl RawQueryResult {
let batch_stream = bytes_stream.flat_map(|bytes_result| match bytes_result {
Ok(bytes) => match Self::bytes_to_batches(bytes) {
Ok(batches) => futures::stream::iter(batches.into_iter().map(Ok)).boxed(),
Err(e) => futures::stream::once(async move { Err(ArrowError::from(e)) }).boxed(),
Err(e) => futures::stream::once(async move { Err(e) }).boxed(),
},
Err(e) => futures::stream::once(async move {
Err(ArrowError::ParseError(format!(
"Unable to parse RecordBatch due to error in bytes stream: {}",
e.to_string()
"Unable to parse RecordBatch due to error in bytes stream: {e}"
)))
})
.boxed(),
Expand Down Expand Up @@ -486,7 +485,7 @@ impl SnowflakeApi {
sql: &str,
enable_streaming: bool,
) -> Result<RawQueryResult, SnowflakeApiError> {
let mut resp = self
let resp = self
.run_sql::<ExecResponse>(sql, QueryType::ArrowQuery)
.await?;
log::debug!("Got query response: {:?}", resp);
Expand Down Expand Up @@ -571,7 +570,7 @@ impl SnowflakeApi {

Ok(resp)
}

fn chunks_to_bytes_stream(&self, data: &QueryExecResponseData) -> RawQueryResult {
let chunk_urls = data
.chunks
Expand Down

0 comments on commit 241e4bf

Please sign in to comment.