Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
clean
  • Loading branch information
WweiL committed Jun 5, 2024
commit d6fcba0d4ae73bc65022355b7c8da90ccae68213
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
* limitations under the License.
*/


// TODO: change me add back test field

package org.apache.spark.sql.streaming

import scala.jdk.CollectionConverters._
Expand Down
1 change: 0 additions & 1 deletion python/pyspark/sql/connect/streaming/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ def lastProgress(self) -> Optional[Dict[str, Any]]:
cmd = pb2.StreamingQueryCommand()
cmd.last_progress = True
progress = self._execute_streaming_query_cmd(cmd).recent_progress.recent_progress_json
# print("wei== progress is: " + str(progress[-1]))
if len(progress) > 0:
return json.loads(progress[-1])
else:
Expand Down
20 changes: 10 additions & 10 deletions python/pyspark/sql/tests/streaming/test_streaming_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,16 @@ def check_sink_progress(self, progress):
self.assertTrue(isinstance(progress.numOutputRows, int))
self.assertTrue(isinstance(progress.metrics, dict))

# def test_streaming_last_progress(self):
# try:
# df = self.spark.readStream.format("text").load("python/test_support/sql/streaming")
# query = df.writeStream.format("noop").queryName("test_streaming_progress").start()
# query.processAllAvailable()
#
# progress = StreamingQueryProgress.fromJson(query.lastProgress)
# self.check_streaming_query_progress(progress, False)
# finally:
# query.stop()
def test_streaming_last_progress(self):
try:
df = self.spark.readStream.format("text").load("python/test_support/sql/streaming")
query = df.writeStream.format("noop").queryName("test_streaming_progress").start()
query.processAllAvailable()

progress = StreamingQueryProgress.fromJson(query.lastProgress)
self.check_streaming_query_progress(progress, False)
finally:
query.stop()

# This is a generic test work for both classic Spark and Spark Connect
def test_listener_observed_metrics(self):
Expand Down