Jefffrey commented on code in PR #5666:
URL: https://github.com/apache/arrow-rs/pull/5666#discussion_r1574410918


##########
arrow-flight/examples/flight_sql_server.rs:
##########
@@ -184,7 +188,21 @@ impl FlightSqlService for FlightSqlServiceImpl {
         };
         let result = Ok(result);
         let output = futures::stream::iter(vec![result]);
-        return Ok(Response::new(Box::pin(output)));
+
+        let token = format!("Bearer {}", FAKE_TOKEN);
+        let mut response: Response<
+            Pin<
+                Box<
+                    dyn Stream<Item = std::result::Result<HandshakeResponse, 
Status>>
+                        + std::marker::Send,
+                >,
+            >,
+        > = Response::new(Box::pin(output));

Review Comment:
   ```suggestion
           let mut response: Response<Pin<Box<dyn Stream<Item = _> + Send>>> =
               Response::new(Box::pin(output));
   ```
   
   Slightly cleaner



##########
arrow-flight/examples/flight_sql_server.rs:
##########
@@ -725,9 +742,8 @@ impl FlightSqlService for FlightSqlServiceImpl {
 /// This example shows how to run a FlightSql server
 #[tokio::main]
 async fn main() -> Result<(), Box<dyn std::error::Error>> {
-    let addr = "0.0.0.0:50051".parse()?;
-
-    let svc = FlightServiceServer::new(FlightSqlServiceImpl {});
+    let addr_str = "127.0.0.1:50051";

Review Comment:
   I guess this should be fine as it's just an example server :thinking: 
   
   Though I do wonder if there's some other way to solve this?



##########
arrow-flight/examples/flight_sql_server.rs:
##########
@@ -999,15 +1028,6 @@ mod tests {
                 .to_string()
                 .contains("Invalid credentials"));
 
-            // forget to set_token
-            client.handshake("admin", "password").await.unwrap();
-            assert!(client
-                .prepare("select 1;".to_string(), None)
-                .await
-                .unwrap_err()
-                .to_string()
-                .contains("No authorization header"));

Review Comment:
   I guess this test is invalid now that client should set the token from the 
returned one from the server?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to