You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "HyukjinKwon (via GitHub)" <gi...@apache.org> on 2023/08/23 03:45:38 UTC

[GitHub] [spark] HyukjinKwon commented on a diff in pull request #42608: [SPARK-42017][PYTHON][CONNECT][TESTS] Enable `ColumnParityTests.test_access_column`

HyukjinKwon commented on code in PR #42608:
URL: https://github.com/apache/spark/pull/42608#discussion_r1302449910


##########
python/pyspark/sql/connect/dataframe.py:
##########
@@ -1623,6 +1624,10 @@ def __getitem__(self, item: Union[int, str, Column, List, Tuple]) -> Union[Colum
             alias = self._get_alias()
             if self._plan is None:
                 raise SparkConnectException("Cannot analyze on empty plan.")
+
+            if "." not in item and "*" not in item and "`" not in item and item not in self.columns:

Review Comment:
   Should we maybe just:
   
   ```python
   col = _to_col_with_plan_id(
       col=alias if alias is not None else item,
       plan_id=self._plan._plan_id,
   )
   self.select(col)
   return col
   ```



-- 
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