Github user marmbrus commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15954#discussion_r90082045
  
    --- Diff: python/pyspark/sql/streaming.py ---
    @@ -87,6 +88,24 @@ def awaitTermination(self, timeout=None):
             else:
                 return self._jsq.awaitTermination()
     
    +    @property
    +    @since(2.1)
    +    def recentProgresses(self):
    +        """Returns an array of the most recent [[StreamingQueryProgress]] 
updates for this query.
    +        The number of progress updates retained for each stream is 
configured by Spark session
    +        configuration `spark.sql.streaming.numRecentProgresses`.
    +        """
    +        return [json.loads(p.json()) for p in self._jsq.recentProgresses()]
    +
    +    @property
    +    @since(2.1)
    +    def lastProgress(self):
    +        """
    +        Returns the most recent :class:`StreamingQueryProgress` update of 
this streaming query.
    +        :return: a map
    +        """
    +        return json.loads(self._jsq.lastProgress().toString())
    --- End diff --
    
    I'd use `json` as above instead of relying on the fact that the `toString` 
is `json`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to