From 60e42d972e30528b87c55b6d12d1b4006b83db02 Mon Sep 17 00:00:00 2001 From: Marko Grujic Date: Fri, 8 Dec 2023 09:57:09 +0100 Subject: [PATCH] Put feature cfg on flight imports --- src/frontend/flight/sql.rs | 2 +- src/main.rs | 1 + tests/flight/client.rs | 3 +-- tests/main.rs | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/frontend/flight/sql.rs b/src/frontend/flight/sql.rs index f02d1d92..e425863a 100644 --- a/src/frontend/flight/sql.rs +++ b/src/frontend/flight/sql.rs @@ -84,7 +84,7 @@ impl FlightSqlService for SeafowlFlightHandler { let flight_info = FlightInfo::new() .try_with_schema(&schema) - .expect("encoding schema") + .map_err(|e| Status::internal(e.to_string()))? .with_endpoint(endpoint) .with_descriptor(request.into_inner()); diff --git a/src/main.rs b/src/main.rs index 88fe4ffb..24a668d6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,6 +12,7 @@ use clap::Parser; use futures::{future::join_all, Future, FutureExt}; use pretty_env_logger::env_logger; +#[cfg(feature = "frontend-arrow-flight")] use seafowl::frontend::flight::run_flight_server; use seafowl::{ cli, diff --git a/tests/flight/client.rs b/tests/flight/client.rs index 7f0473e3..53dda798 100644 --- a/tests/flight/client.rs +++ b/tests/flight/client.rs @@ -35,9 +35,8 @@ async fn test_basic_queries() -> Result<()> { .clone() .expect("expected ticket"); - // Retrieve the corresponding Flight stream with do_get + // Retrieve the corresponding Flight stream and collect into batches let flight_stream = client.do_get(ticket).await.expect("error fetching data"); - let results: Vec = flight_stream.try_collect().await?; let expected = [ diff --git a/tests/main.rs b/tests/main.rs index c746400c..e458a56c 100644 --- a/tests/main.rs +++ b/tests/main.rs @@ -2,6 +2,7 @@ // https://endler.dev/2020/rust-compile-times/#combine-all-integration-tests-in-a-single-binary mod cli; +#[cfg(feature = "frontend-arrow-flight")] mod flight; mod http; mod statements;