Skip to content

Commit

Permalink
adjust comment
Browse files Browse the repository at this point in the history
  • Loading branch information
itholic committed Oct 17, 2024
1 parent 79cefd3 commit d067dab
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions python/pyspark/sql/tests/test_connect_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@


class ConnectCompatibilityTestsMixin:
def _get_public_methods(self, cls):
def get_public_methods(self, cls):
"""Get public methods of a class."""
return {
name: method
Expand All @@ -43,7 +43,7 @@ def _get_public_methods(self, cls):
and not name.startswith("_")
}

def _get_public_properties(self, cls):
def get_public_properties(self, cls):
"""Get public properties of a class."""
return {
name: member
Expand All @@ -52,10 +52,10 @@ def _get_public_properties(self, cls):
and not name.startswith("_")
}

def _compare_method_signatures(self, classic_cls, connect_cls, cls_name):
def compare_method_signatures(self, classic_cls, connect_cls, cls_name):
"""Compare method signatures between classic and connect classes."""
classic_methods = self._get_public_methods(classic_cls)
connect_methods = self._get_public_methods(connect_cls)
classic_methods = self.get_public_methods(classic_cls)
connect_methods = self.get_public_methods(connect_cls)

common_methods = set(classic_methods.keys()) & set(connect_methods.keys())

Expand All @@ -72,7 +72,7 @@ def _compare_method_signatures(self, classic_cls, connect_cls, cls_name):
f"Connect: {connect_signature}",
)

def _compare_property_lists(
def compare_property_lists(
self,
classic_cls,
connect_cls,
Expand All @@ -81,8 +81,8 @@ def _compare_property_lists(
expected_missing_classic_properties,
):
"""Compare properties between classic and connect classes."""
classic_properties = self._get_public_properties(classic_cls)
connect_properties = self._get_public_properties(connect_cls)
classic_properties = self.get_public_properties(classic_cls)
connect_properties = self.get_public_properties(connect_cls)

# Identify missing properties
classic_only_properties = set(classic_properties.keys()) - set(connect_properties.keys())
Expand All @@ -102,7 +102,7 @@ def _compare_property_lists(
f"{cls_name}: Unexpected missing properties in Classic: {connect_only_properties}",
)

def _check_missing_methods(
def check_missing_methods(
self,
classic_cls,
connect_cls,
Expand All @@ -111,8 +111,8 @@ def _check_missing_methods(
expected_missing_classic_methods,
):
"""Check for expected missing methods between classic and connect classes."""
classic_methods = self._get_public_methods(classic_cls)
connect_methods = self._get_public_methods(connect_cls)
classic_methods = self.get_public_methods(classic_cls)
connect_methods = self.get_public_methods(connect_cls)

# Identify missing methods
classic_only_methods = set(classic_methods.keys()) - set(connect_methods.keys())
Expand Down Expand Up @@ -167,15 +167,15 @@ def check_compatibility(
expected_missing_classic_methods : set
A set of methods expected to be missing in the classic class.
"""
self._compare_method_signatures(classic_cls, connect_cls, cls_name)
self._compare_property_lists(
self.compare_method_signatures(classic_cls, connect_cls, cls_name)
self.compare_property_lists(
classic_cls,
connect_cls,
cls_name,
expected_missing_connect_properties,
expected_missing_classic_properties,
)
self._check_missing_methods(
self.check_missing_methods(
classic_cls,
connect_cls,
cls_name,
Expand Down

0 comments on commit d067dab

Please sign in to comment.