WweiL commented on code in PR #46921:
URL: https://github.com/apache/spark/pull/46921#discussion_r1631855722
##########
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:
I'm not sure if this is really needed. But if we delete this if, now
"query.lastProgress["id"]" would return type uuid, before it was string.
--
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]