zero323 commented on a change in pull request #34671:
URL: https://github.com/apache/spark/pull/34671#discussion_r754559725
##########
File path: python/pyspark/mllib/_typing.pyi
##########
@@ -16,8 +16,11 @@
# specific language governing permissions and limitations
# under the License.
-from typing import List, Tuple, Union
+from typing import List, Tuple, TypeVar, Union
from pyspark.mllib.linalg import Vector
from numpy import ndarray # noqa: F401
+from py4j.java_gateway import JavaObject
VectorLike = Union[ndarray, Vector, List[float], Tuple[float, ...]]
+C = TypeVar("C", bound=type)
+JavaObjectType = Union[JavaObject, bytearray, bytes]
Review comment:
I think it makes more sense to inline this `Union` directly where it is
used ‒ it is not shared, and alias doesn't really help to understand meaning of
the unioned types.
--
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]