amaliujia commented on code in PR #38723:
URL: https://github.com/apache/spark/pull/38723#discussion_r1028411766


##########
python/pyspark/sql/connect/column.py:
##########
@@ -263,6 +263,22 @@ def __str__(self) -> str:
         return f"Column({self._unparsed_identifier})"
 
 
+class SQLExpression(Expression):
+    """Returns Expression which contains a string which is a SQL expression
+    and server side will parse it by Catalyst
+    """
+
+    def __init__(self, expr: str) -> None:
+        super().__init__()

Review Comment:
   In this implementation, we don't need to because the caller has verified the 
type (thus mypy does not complain).
   
   I think this is a good question:
   Generally speaking, I think for public API, we should throw user-facing 
exception, for internal API, we can assert when we want to defensive check 
unexpected input.
   
   So it is a question of if we want to enforce checking cross all 
public/private API  (by corresponding ways). I guess maybe not now but worth it 
at a right time (maybe before 3.4 release).
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to