JoshRosen commented on code in PR #45885:
URL: https://github.com/apache/spark/pull/45885#discussion_r1552615456


##########
python/pyspark/sql/dataframe.py:
##########
@@ -589,16 +589,18 @@ def writeStream(self) -> DataStreamWriter:
 
         Examples
         --------
+        >>> import time
         >>> import tempfile
         >>> df = spark.readStream.format("rate").load()
         >>> type(df.writeStream)
         <class '...streaming.readwriter.DataStreamWriter'>
 
         >>> with tempfile.TemporaryDirectory(prefix="writeStream") as d:
         ...     # Create a table with Rate source.
-        ...     df.writeStream.toTable(
+        ...     query = df.writeStream.toTable(
         ...         "my_table", checkpointLocation=d)
-        <...streaming.query.StreamingQuery object at 0x...>
+        ...     time.sleep(3)

Review Comment:
   Copied this from 
https://github.com/apache/spark/blob/960208539526a8451d672ec85c7a15dd039c6b6f/python/pyspark/sql/dataframe.py#L1246-L1253



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