nchammas commented on code in PR #60228:
URL: https://github.com/apache/spark/pull/60228#discussion_r4508939947


##########
python/pyspark/sql/connect/streaming/query.py:
##########
@@ -88,7 +89,12 @@ def awaitTermination(self, timeout: Optional[int] = None) -> 
Optional[bool]:
                     errorClass="VALUE_NOT_POSITIVE",
                     messageParameters={"arg_name": "timeout", "arg_value": 
type(timeout).__name__},
                 )
-            cmd.await_termination.timeout_ms = int(timeout * 1000)
+            if not math.isfinite(timeout):
+                raise PySparkValueError(
+                    errorClass="VALUE_NOT_FINITE",
+                    messageParameters={"arg_name": "timeout", "arg_value": 
str(timeout)},
+                )
+            cmd.await_termination.timeout_ms = math.ceil(timeout * 1000)

Review Comment:
   Rounding up is a qualitatively separate change from the added error 
condition. Might be safe to do, but muddies the scope a bit of this otherwise 
focused PR. Was this discussed in a prior thread or PR?



##########
python/pyspark/sql/tests/streaming/test_streaming_query_validation.py:
##########
@@ -0,0 +1,153 @@
+#

Review Comment:
   Why not put these tests in 
`python/pyspark/sql/tests/streaming/test_streaming.py`? Connect inherits those 
tests automatically, I think.



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