You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "ueshin (via GitHub)" <gi...@apache.org> on 2023/02/11 00:43:29 UTC

[GitHub] [spark] ueshin commented on a diff in pull request #39971: [SPARK-42402][CONNECT] Support parameterized SQL by `sql()`

ueshin commented on code in PR #39971:
URL: https://github.com/apache/spark/pull/39971#discussion_r1103446098


##########
python/pyspark/sql/session.py:
##########
@@ -1308,7 +1308,7 @@ def prepare(obj: Any) -> Any:
         df._schema = struct
         return df
 
-    def sql(self, sqlQuery: str, args: Dict[str, str] = {}, **kwargs: Any) -> DataFrame:
+    def sql(self, sqlQuery: str, args: Optional[Dict[str, str]] = None, **kwargs: Any) -> DataFrame:

Review Comment:
   Also fix the default parameter to `None` instead of `{}` to avoid unexpected behavior.



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