zhengruifeng commented on code in PR #38742: URL: https://github.com/apache/spark/pull/38742#discussion_r1032103353
########## python/pyspark/sql/connect/dataframe.py: ########## @@ -822,6 +821,83 @@ def schema(self) -> StructType: else: return self._schema + @property + def isLocal(self) -> bool: + """Returns ``True`` if the :func:`collect` and :func:`take` methods can be run locally + (without any Spark executors). + + .. versionadded:: 3.4.0 + + Returns + ------- + bool + """ + if self._plan is None: + raise Exception("Cannot analyze on empty plan.") + query = self._plan.to_proto(self._session) + return self._session._analyze(query).is_local Review Comment: https://github.com/apache/spark/pull/38742#discussion_r1028915567 I think we will do the caching in near future. -- 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