xinrong-databricks commented on a change in pull request #34061:
URL: https://github.com/apache/spark/pull/34061#discussion_r714200185
##########
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
Review comment:
Good idea, then we don't rely on how `to_frame` processes input without
a name. Updated.
--
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]