ueshin commented on a change in pull request #34061:
URL: https://github.com/apache/spark/pull/34061#discussion_r713498444
##########
File path: python/pyspark/pandas/indexing.py
##########
@@ -439,7 +440,8 @@ def __getitem__(self, key: Any) -> Union["Series",
"DataFrame"]:
temp_col = verify_temp_column_name(psdf, "__temp_col__")
psdf[temp_col] = key
- return
type(self)(psdf[self._psdf_or_psser.name])[psdf[temp_col]]
+ name = self._psdf_or_psser.name or DEFAULT_SERIES_NAME
+ return cast(Series,
psdf[name][psdf[temp_col]]).rename(self._psdf_or_psser.name)
Review comment:
This is not what the original one is expecting.
Should be:
```py
return
type(self)(psdf[name])[psdf[temp_col]].rename(self._psdf_or_psser.name)
```
?
--
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]