[SPARK-41149][PYTHON] Fix SparkSession.builder.config to support bool#38673
Closed
itholic wants to merge 2 commits intoapache:masterfrom
Closed
[SPARK-41149][PYTHON] Fix SparkSession.builder.config to support bool#38673itholic wants to merge 2 commits intoapache:masterfrom
SparkSession.builder.config to support bool#38673itholic wants to merge 2 commits intoapache:masterfrom
Conversation
HyukjinKwon
reviewed
Nov 17, 2022
WeichenXu123
approved these changes
Nov 17, 2022
HyukjinKwon
approved these changes
Nov 17, 2022
Member
|
Merged to master. |
SandishKumarHN
pushed a commit
to SandishKumarHN/spark
that referenced
this pull request
Dec 12, 2022
### What changes were proposed in this pull request?
This PR proposes to support `bool` type for `SparkSession.builder.config` when building the new `SparkSession`.
### Why are the changes needed?
Currently, Python `bool` type `True` or `False` is not working correctly, since JVM side only treat the String type of "true" or "false" as a valid option value.
So, this PR basically fix the current behavior as below:
**Before**
```python
>>> s1 = spark.builder.config("spark.sql.pyspark.jvmStacktrace.enabled", True).getOrCreate()
>>> s1.conf.get("spark.sql.pyspark.jvmStacktrace.enabled")
'True' # invalid value, no effect for options.
```
**After**
```python
>>> s1 = spark.builder.config("spark.sql.pyspark.jvmStacktrace.enabled", True).getOrCreate()
>>> s1.conf.get("spark.sql.pyspark.jvmStacktrace.enabled")
'true' # the lower case "true" only valid for options.
```
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Unittest added.
Closes apache#38673 from itholic/SPARK-41149.
Authored-by: itholic <haejoon.lee@databricks.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
beliefer
pushed a commit
to beliefer/spark
that referenced
this pull request
Dec 15, 2022
### What changes were proposed in this pull request?
This PR proposes to support `bool` type for `SparkSession.builder.config` when building the new `SparkSession`.
### Why are the changes needed?
Currently, Python `bool` type `True` or `False` is not working correctly, since JVM side only treat the String type of "true" or "false" as a valid option value.
So, this PR basically fix the current behavior as below:
**Before**
```python
>>> s1 = spark.builder.config("spark.sql.pyspark.jvmStacktrace.enabled", True).getOrCreate()
>>> s1.conf.get("spark.sql.pyspark.jvmStacktrace.enabled")
'True' # invalid value, no effect for options.
```
**After**
```python
>>> s1 = spark.builder.config("spark.sql.pyspark.jvmStacktrace.enabled", True).getOrCreate()
>>> s1.conf.get("spark.sql.pyspark.jvmStacktrace.enabled")
'true' # the lower case "true" only valid for options.
```
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Unittest added.
Closes apache#38673 from itholic/SPARK-41149.
Authored-by: itholic <haejoon.lee@databricks.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
beliefer
pushed a commit
to beliefer/spark
that referenced
this pull request
Dec 18, 2022
### What changes were proposed in this pull request?
This PR proposes to support `bool` type for `SparkSession.builder.config` when building the new `SparkSession`.
### Why are the changes needed?
Currently, Python `bool` type `True` or `False` is not working correctly, since JVM side only treat the String type of "true" or "false" as a valid option value.
So, this PR basically fix the current behavior as below:
**Before**
```python
>>> s1 = spark.builder.config("spark.sql.pyspark.jvmStacktrace.enabled", True).getOrCreate()
>>> s1.conf.get("spark.sql.pyspark.jvmStacktrace.enabled")
'True' # invalid value, no effect for options.
```
**After**
```python
>>> s1 = spark.builder.config("spark.sql.pyspark.jvmStacktrace.enabled", True).getOrCreate()
>>> s1.conf.get("spark.sql.pyspark.jvmStacktrace.enabled")
'true' # the lower case "true" only valid for options.
```
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Unittest added.
Closes apache#38673 from itholic/SPARK-41149.
Authored-by: itholic <haejoon.lee@databricks.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR proposes to support
booltype forSparkSession.builder.configwhen building the newSparkSession.Why are the changes needed?
Currently, Python
booltypeTrueorFalseis not working correctly, since JVM side only treat the String type of "true" or "false" as a valid option value.So, this PR basically fix the current behavior as below:
Before
After
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Unittest added.