zero323 commented on a change in pull request #35252:
URL: https://github.com/apache/spark/pull/35252#discussion_r793700632
##########
File path: python/pyspark/_typing.pyi
##########
@@ -17,17 +17,27 @@
# under the License.
from typing import Callable, Iterable, Sized, TypeVar, Union
-from typing_extensions import Protocol
+from typing_extensions import Literal, Protocol
+
+from numpy import int32, int64, float32, float64, ndarray
F = TypeVar("F", bound=Callable)
T_co = TypeVar("T_co", covariant=True)
PrimitiveType = Union[bool, float, int, str]
+NonUDFType = Literal[0]
+
class SupportsIAdd(Protocol):
def __iadd__(self, other: SupportsIAdd) -> SupportsIAdd: ...
class SupportsOrdering(Protocol):
- def __le__(self, other: SupportsOrdering) -> bool: ...
+ def __lt__(self, other: SupportsOrdering) -> bool: ...
class SizedIterable(Protocol, Sized, Iterable[T_co]): ...
+
+O = TypeVar("O", bound=SupportsOrdering)
Review comment:
I've noticed this as well. It suppose to serve as a mnemonic ‒ "O" like
**O**rderable.
The reason why I kept it so far, is that it is pain to refactor it, with all
the quoted strings (I don't think we have data tests that will break, but
that's another pain when you change names) 😅
--
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]