HyukjinKwon commented on code in PR #36161:
URL: https://github.com/apache/spark/pull/36161#discussion_r848988214
##########
python/pyspark/sql/session.py:
##########
@@ -276,8 +312,10 @@ def getOrCreate(self) -> "SparkSession":
).applyModifiableSettings(session._jsparkSession,
self._options)
return session
- builder = Builder()
- """A class attribute having a :class:`Builder` to construct
:class:`SparkSession` instances."""
+ @classproperty
Review Comment:
I think we should probably just refer to the official Python docs e.g.,
https://docs.python.org/3/howto/descriptor.html#class-methods
Meaning that you might just override `__get__` in `SparkSession`. In
addition, we should probably have to add some comment that this codes can be
removed when we drop Python 3.8 as a classmethod and property could be chained
together from Python 3.9.
--
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]