rangadi commented on code in PR #42437:
URL: https://github.com/apache/spark/pull/42437#discussion_r1290654289


##########
python/pyspark/sql/tests/streaming/test_streaming.py:
##########
@@ -315,6 +315,19 @@ def _assert_exception_tree_contains_msg_default(self, 
exception, msg):
             contains = msg in e.desc
         self.assertTrue(contains, "Exception tree doesn't contain the expected 
message: %s" % msg)
 
+    def test_query_manager_get(self):
+        df = self.spark.readStream.format("rate").load()
+        for q in self.spark.streams.active:
+            q.stop()

Review Comment:
   What is this for? 



##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectPlanner.scala:
##########
@@ -3061,8 +3061,8 @@ class SparkConnectPlanner(val sessionHolder: 
SessionHolder) extends Logging {
             .asJava)
 
       case StreamingQueryManagerCommand.CommandCase.GET_QUERY =>
-        val query = session.streams.get(command.getGetQuery)
-        respBuilder.setQuery(buildStreamingQueryInstance(query))
+        val query = Option(session.streams.get(command.getGetQuery))
+        query.foreach { q => 
respBuilder.setQuery(buildStreamingQueryInstance(q)) }

Review Comment:
   Style suggestion: Can remove `val query`:
   ```
   Option(session.streams.get(command.getGetQuery)).foreach { q =>
    respBuilder.setQuery(buildStreamingQueryInstance(q))
   }
   ```
   
   
   



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to