itholic commented on code in PR #48651:
URL: https://github.com/apache/spark/pull/48651#discussion_r1843103065
##########
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:
@xupefei just applied the comments. Could you review again when you find
some time? Thanks!
Also cc @HyukjinKwon now we apply the `@spark_connect_only` decorator for
APIs that are only supported with Spark Connect and use it from the testing
instead of string comparison.
--
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]