dchvn commented on a change in pull request #34510:
URL: https://github.com/apache/spark/pull/34510#discussion_r746442510
##########
File path: python/pyspark/mllib/stat/test.py
##########
@@ -15,68 +15,72 @@
# limitations under the License.
#
+from typing import Generic, Tuple, TypeVar
+
from pyspark.mllib.common import inherit_doc, JavaModelWrapper
__all__ = ["ChiSqTestResult", "KolmogorovSmirnovTestResult"]
+DF = TypeVar("DF", int, float, Tuple[int, ...], Tuple[float, ...])
+
-class TestResult(JavaModelWrapper):
+class TestResult(JavaModelWrapper, Generic[DF]):
"""
Base class for all test results.
"""
@property
- def pValue(self):
+ def pValue(self) -> float:
"""
The probability of obtaining a test statistic result at least as
extreme as the one that was actually observed, assuming that the
null hypothesis is true.
"""
- return self._java_model.pValue()
+ return self._java_model.pValue() # type: ignore[attr-defined]
Review comment:
Updated! Thank you, @zero323 .
--
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]