zero323 commented on a change in pull request #34227:
URL: https://github.com/apache/spark/pull/34227#discussion_r725369691
##########
File path: python/pyspark/pandas/frame.py
##########
@@ -10439,8 +10443,9 @@ def gen_names(
v: Union[Any, Sequence[Any], Dict[Name, Any], Callable[[Name],
Any]],
curnames: List[Name],
) -> List[Label]:
+ newnames: List[Name]
if is_scalar(v):
- newnames = [cast(Any, v)] # type: List[Name]
+ newnames = [cast(Any, v)]
elif is_list_like(v) and not is_dict_like(v):
newnames = list(cast(Sequence[Any], v))
Review comment:
Couldn't these `cast` to `Name`? It's still `Any`, but intention might
be clearer and should be still valid if `Name` type is ever refined.
--
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]