Skip to content

Commit 4087464

Browse files
Ubuntuanishshri-db
authored andcommitted
[SPARK-53972][SS] Fix streaming query recentProgress regression in classic pyspark
### What changes were proposed in this pull request? See #52688 for details. This PR is to backport the changes to Spark 4.0 ### Why are the changes needed? See #52688 ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? See #52688 ### Was this patch authored or co-authored using generative AI tooling? No Closes #52698 from zifeif2/recent-progress-bug-4.0. Authored-by: Ubuntu <[email protected]> Signed-off-by: Anish Shrigondekar <[email protected]>
1 parent 4a72b04 commit 4087464

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

python/pyspark/sql/streaming/query.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,10 @@ def recentProgress(self) -> List[StreamingQueryProgress]:
283283
284284
>>> sq.stop()
285285
"""
286-
return [StreamingQueryProgress.fromJObject(p) for p in self._jsq.recentProgress()]
286+
return [
287+
StreamingQueryProgress.fromJson(json.loads(p.json()))
288+
for p in self._jsq.recentProgress()
289+
]
287290

288291
@property
289292
def lastProgress(self) -> Optional[StreamingQueryProgress]:
@@ -314,7 +317,7 @@ def lastProgress(self) -> Optional[StreamingQueryProgress]:
314317
"""
315318
lastProgress = self._jsq.lastProgress()
316319
if lastProgress:
317-
return StreamingQueryProgress.fromJObject(lastProgress)
320+
return StreamingQueryProgress.fromJson(json.loads(lastProgress.json()))
318321
else:
319322
return None
320323

0 commit comments

Comments
 (0)