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 2024/03/01 20:06:51 UTC

[PR] [SPARK-47251][PYTHON] Block invalid types from the `args` argument for `sql` command [spark]

ueshin opened a new pull request, #45361:
URL: https://github.com/apache/spark/pull/45361

   ### What changes were proposed in this pull request?
   
   Blocks invalid types from the `args` argument for `sql` command.
   
   Additionally, uses a `PySparkValueError` instead of assertions.
   
   ### Why are the changes needed?
   
   Currently the vanilla PySpark accepts any value, even `set`, which could cause unexpected results because `set` won't guarantee the item order.
   
   ```py
   >>> spark.sql("select ?, ?, ?", args={2,1,3}).show()
   +---+---+---+
   |  1|  2|  3|
   +---+---+---+
   |  1|  2|  3|
   +---+---+---+
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, the `args` argument for `sql` command will only accept `None`, `dict`, or `list`.
   
   ### How was this patch tested?
   
   Added the related tests.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   No.


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


Re: [PR] [SPARK-47251][PYTHON] Block invalid types from the `args` argument for `sql` command [spark]

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon closed pull request #45361: [SPARK-47251][PYTHON] Block invalid types from the `args` argument for `sql` command
URL: https://github.com/apache/spark/pull/45361


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


Re: [PR] [SPARK-47251][PYTHON] Block invalid types from the `args` argument for `sql` command [spark]

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on PR #45361:
URL: https://github.com/apache/spark/pull/45361#issuecomment-1974704678

   Merged to master.


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