WweiL commented on code in PR #46921:
URL: https://github.com/apache/spark/pull/46921#discussion_r1631855885


##########
python/pyspark/sql/streaming/listener.py:
##########
@@ -497,6 +499,19 @@ def fromJson(cls, j: Dict[str, Any]) -> 
"StreamingQueryProgress":
             else {},
         )
 
+    def __getitem__(self, key):
+        # Before Spark 4.0, StreamingQuery.lastProgress returns a dict, which 
casts id and runId
+        # to string. To prevent breaking change, also cast them to string when 
accessed with
+        # __getitem__.
+        if key == "id" or key == "runId":

Review Comment:
   Because there would be lots of breaking changes (e.g. now the `sources` 
method also return the actual `SourceProgress`
   
https://github.com/apache/spark/blob/ef7a116828d1781dde35d422550ff369c548a6aa/python/pyspark/sql/streaming/listener.py#L595
   
   let me also make these subclass of dict... 



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to