tigerhawkvok opened a new pull request, #48662: URL: https://github.com/apache/spark/pull/48662
Add type overloads for inplace dataframe operationsctly show a return of None or DataFrame based on flag state. Additionally adds one small type check function, `validate_strict_bool()` to wrap `validate_bool_kwargs()` for `inplace`, as `validate_bool_kwargs()` accepts `bool` or `None`; but `inplace` can only be `bool`. Aside from that very minor function edit, all other changes are exclusively to type hints. Simple test case: ```python from typing import Any, cast from pyspark.pandas import DataFrame foo = cast(DataFrame, None).sort_index() bar = cast(DataFrame, None).sort_index(inplace= True) bam = bool(cast(Any, None)) baz = cast(DataFrame, None).sort_index(inplace= bam) ``` Before: The union is returned regardless of state of `inplace`    After: - `inplace` is implicitly or explicitly `True` returns a `DataFrame`  - `inplace` is explicitly `False` returns `None`  - `inplace` is ambiguous and either `True` or `False`, still returns `Union[DataFrame, None]`   -- 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]
