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/08/23 02:12:11 UTC

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

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


##########
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:
   similar to https://github.com/apache/spark/commit/91e97f92fe76f9718cd16af0c761d5530bdb37ee, but need to cases like `*`, `a.*`, ``aa.bb``



##########
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:
   similar to https://github.com/apache/spark/commit/91e97f92fe76f9718cd16af0c761d5530bdb37ee, but need to skip cases like `*`, `a.*`, ``aa.bb``



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