Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshRosen committed Apr 4, 2024
1 parent 240923c commit ce7580f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/pyspark/sql/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,15 +589,19 @@ 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)
... print(type(query))
... time.sleep(3)
... query.stop()
<...streaming.query.StreamingQuery object at 0x...>
"""
return DataStreamWriter(self)
Expand Down

0 comments on commit ce7580f

Please sign in to comment.