AlejandroMorgante commented on code in PR #60228:
URL: https://github.com/apache/spark/pull/60228#discussion_r4509048421
##########
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:
You're right, thanks -- split it out into #60230, kept just the nan/inf
error here.
##########
python/pyspark/sql/tests/streaming/test_streaming_query_validation.py:
##########
@@ -0,0 +1,153 @@
+#
Review Comment:
Fair point, and you're right that Connect inherits StreamingTestsMixin's
tests automatically (confirmed --
test_stream_await_termination/test_query_manager_await_termination there run
under test_parity_streaming.StreamingParityTests too). Kept this separate on
purpose though: those mixin tests need a real SparkSession and a running query,
while this is pure input validation that doesn't -- and a real end-to-end query
can't easily assert the exact millisecond value received, which is the whole
point of these tests. Appreciate the perspective either way.
--
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]