You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zhengruifeng (via GitHub)" <gi...@apache.org> on 2023/09/07 01:36:37 UTC

[GitHub] [spark] zhengruifeng commented on a diff in pull request #42828: [SPARK-45088][PYTHON][CONNECT] Make `getitem` work with duplicated columns

zhengruifeng commented on code in PR #42828:
URL: https://github.com/apache/spark/pull/42828#discussion_r1317989896


##########
python/pyspark/sql/dataframe.py:
##########
@@ -3455,8 +3455,14 @@ def __getitem__(self, item: Union[int, str, Column, List, Tuple]) -> Union[Colum
             return self.filter(item)
         elif isinstance(item, (list, tuple)):
             return self.select(*item)
-        elif isinstance(item, int):
-            jc = self._jdf.apply(self.columns[item])
+        elif isinstance(item, int) and not isinstance(item, bool):

Review Comment:
   ok, let me revert this part and add test cases for `bool`



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org