itholic commented on code in PR #48651:
URL: https://github.com/apache/spark/pull/48651#discussion_r1820066066
##########
python/pyspark/sql/tests/test_connect_compatibility.py:
##########
@@ -60,16 +60,23 @@
from pyspark.sql.connect.streaming.readwriter import DataStreamReader as
ConnectDataStreamReader
from pyspark.sql.connect.streaming.readwriter import DataStreamWriter as
ConnectDataStreamWriter
+SPARK_CONNECT_ONLY = "spark_connect_only"
+
class ConnectCompatibilityTestsMixin:
def get_public_methods(self, cls):
"""Get public methods of a class."""
- return {
- name: method
- for name, method in inspect.getmembers(cls)
- if (inspect.isfunction(method) or isinstance(method,
functools._lru_cache_wrapper))
- and not name.startswith("_")
- }
+ methods = {}
+ for name, method in inspect.getmembers(cls):
+ if (
+ inspect.isfunction(method) or isinstance(method,
functools._lru_cache_wrapper)
+ ) and not name.startswith("_"):
+ source_lines = inspect.getsource(method).upper()
+ if "ONLY_SUPPORTED_WITH_SPARK_CONNECT" in source_lines:
Review Comment:
Agree that it's flaky but I believe this is currently the only way to check
functions that only supported from connect.
Should we just close it? Also cc @hvanhovell
--
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]