You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/12/01 08:26:17 UTC

[GitHub] [spark] grundprinzip commented on a diff in pull request #38858: [SPARK-41346][CONNECT][PYTHON] Implement `asc` and `desc` functions

grundprinzip commented on code in PR #38858:
URL: https://github.com/apache/spark/pull/38858#discussion_r1036816655


##########
python/pyspark/sql/connect/functions.py:
##########
@@ -16,14 +16,247 @@
 #
 from pyspark.sql.connect.column import Column, LiteralExpression, ColumnReference
 
-from typing import Any
+from typing import Any, TYPE_CHECKING
+
+if TYPE_CHECKING:
+    from pyspark.sql.connect._typing import ColumnOrName
 
 # TODO(SPARK-40538) Add support for the missing PySpark functions.
 
 
+def _to_col(col: "ColumnOrName") -> Column:
+    return col if isinstance(col, Column) else column(col)

Review Comment:
   ```suggestion
       return col if isinstance(col, Column) else Column(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