jaceklaskowski commented on code in PR #41695:
URL: https://github.com/apache/spark/pull/41695#discussion_r1238175370


##########
python/pyspark/pandas/sql_formatter.py:
##########
@@ -102,7 +102,7 @@ def sql(
             e      f       3  6
 
             Also note that the index name(s) should be matched to the existing 
name.
-    args : dict
+    args : dict or list
         A dictionary of parameter names to Python objects that can be 
converted to

Review Comment:
   If args can be a list, should the description be somehow changed to include 
this option? It just says "A dictionary of parameters..."



##########
python/pyspark/sql/session.py:
##########
@@ -1410,28 +1410,35 @@ def prepare(obj: Any) -> Any:
         df._schema = struct
         return df
 
-    def sql(self, sqlQuery: str, args: Optional[Dict[str, Any]] = None, 
**kwargs: Any) -> DataFrame:
+    def sql(
+        self, sqlQuery: str, args: Optional[Union[Dict[str, Any], List]] = 
None, **kwargs: Any
+    ) -> DataFrame:
         """Returns a :class:`DataFrame` representing the result of the given 
query.
         When ``kwargs`` is specified, this method formats the given string by 
using the Python
-        standard formatter. The method binds named parameters to SQL literals 
from `args`.
+        standard formatter. The method binds named parameters to SQL literals 
or
+        positional parameters from `args`. It doesn't support named and 
positional parameters
+        in the same SQL query.
 
         .. versionadded:: 2.0.0
 
         .. versionchanged:: 3.4.0
             Supports Spark Connect and parameterized SQL.
 
+        .. versionchanged:: 3.5.0
+            Supports parameterized SQL with positional parameters.

Review Comment:
   nit: No need for "Supports" since this section is all about what has been 
changed (added?)



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