zero323 commented on a change in pull request #30985:
URL: https://github.com/apache/spark/pull/30985#discussion_r551338698
##########
File path: python/pyspark/util.py
##########
@@ -323,6 +323,18 @@ def __del__(self):
thread_connection.close()
+class PySparkWarning(UserWarning):
+ """A base class for PySpark warnings."""
+
+
+class PySparkFutureWarning(PySparkWarning, FutureWarning):
+ """A base class for deprecated PySpark APIs."""
+
+
+class PySparkResourceWarning(PySparkWarning, ResourceWarning):
+ """A base class for PySpark warnings related to resource usage."""
Review comment:
Thanks for looking at this @HyukjinKwon.
The type hierarchy I had in mind was something like this, where
PySpark-specific warnings inherit from top-level `PySparkWarning` and,
optionally, from base Python warning classes.

The reason I thought about this design is to have better control over
warning filtering ‒ built-in mechanism, IMHO, is a bit limited here.
However, I am not that convinced that this is necessary and I am happy to
limit the scope of this PR to built-in exceptions only (I recognize it might be
an over-engineering and the problem I see with warnings is too localized).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]