Skip to content
Prev Previous commit
Next Next commit
minor
  • Loading branch information
WweiL committed Jun 8, 2024
commit 707d5bd2312683f08e87e792e4d8fdf265ffeae9
4 changes: 2 additions & 2 deletions python/pyspark/sql/streaming/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,8 @@ def fromJson(cls, j: Dict[str, Any]) -> "StreamingQueryProgress":

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__.
# to string. But here they are UUID.
# To prevent breaking change, also cast them to string when accessed with __getitem__.
if key == "id" or key == "runId":
Copy link
Contributor Author

@WweiL WweiL Jun 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because there would be lots of breaking changes (e.g. now the sources method also return the actual SourceProgress

def sources(self) -> List["SourceProgress"]:

let me also make these subclass of dict...

return str(getattr(self, key))
else:
Expand Down