itholic commented on code in PR #48651:
URL: https://github.com/apache/spark/pull/48651#discussion_r1839069402


##########
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:
   > How about using a new decorator @SparkConnectOnly
   
   It sounds like a reasonable suggestion.
   Let me create a separate PR and will ping you guys when it's ready.



-- 
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]

Reply via email to