EnricoMi commented on a change in pull request #33545:
URL: https://github.com/apache/spark/pull/33545#discussion_r679137829
##########
File path: python/pyspark/sql/observation.py
##########
@@ -112,12 +115,13 @@ def get(self):
Returns
-------
- :class:`Row`
+ :class:`Dict`
the observed metrics
"""
assert self._jo is not None, 'call DataFrame.observe'
- jrow = self._jo.get()
- return self._to_row(jrow)
+ jmap = self._jo.getAsJavaMap()
+ # return a pure Python dict, not a py4j JavaMap
+ return {k: v for k, v in jmap.items()}
Review comment:
no, that is a JavaMap, a py4j implementation of dict that syncs changes
of the Python dict back to the Java map inside the jvm
--
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]