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/14 01:21:44 UTC

[GitHub] [spark] zhengruifeng commented on a diff in pull request #39035: [SPARK-41438][CONNECT][PYTHON] Implement `DataFrame.colRegex`

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


##########
python/pyspark/sql/connect/column.py:
##########
@@ -452,6 +452,25 @@ def __repr__(self) -> str:
             return f"{self._name}({', '.join([str(arg) for arg in self._args])})"
 
 
+class UnresolvedRegex(Expression):
+    def __init__(
+        self,
+        col_name: str,
+    ) -> None:
+        super().__init__()
+
+        assert isinstance(col_name, str)
+        self.col_name = col_name
+
+    def to_plan(self, session: "SparkConnectClient") -> proto.Expression:
+        expr = proto.Expression()
+        expr.unresolved_regex.col_name = self.col_name
+        return expr
+
+    def __repr__(self) -> str:
+        return f"{self.col_name}"

Review Comment:
   ```suggestion
           return f"UnresolvedRegex({self.col_name})"
   ```



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