[SPARK-23691][PYTHON][BRANCH-2.3] Use sql_conf util in PySpark tests where possible#20863
Closed
HyukjinKwon wants to merge 2 commits intoapache:branch-2.3from
Closed
[SPARK-23691][PYTHON][BRANCH-2.3] Use sql_conf util in PySpark tests where possible#20863HyukjinKwon wants to merge 2 commits intoapache:branch-2.3from
HyukjinKwon wants to merge 2 commits intoapache:branch-2.3from
Conversation
apache@d6632d1 added an useful util ```python contextmanager def sql_conf(self, pairs): ... ``` to allow configuration set/unset within a block: ```python with self.sql_conf({"spark.blah.blah.blah", "blah"}) # test codes ``` This PR proposes to use this util where possible in PySpark tests. Note that there look already few places affecting tests without restoring the original value back in unittest classes. Manually tested via: ``` ./run-tests --modules=pyspark-sql --python-executables=python2 ./run-tests --modules=pyspark-sql --python-executables=python3 ``` Author: hyukjinkwon <gurwls223@gmail.com> Closes apache#20830 from HyukjinKwon/cleanup-sql-conf.
HyukjinKwon
commented
Mar 20, 2018
| "\n\nResult:\n%s\n%s" % (result, result.dtypes)) | ||
| self.assertTrue(expected.equals(result), msg=msg) | ||
|
|
||
| @contextmanager |
HyukjinKwon
commented
Mar 20, 2018
| df1 = self.spark.range(1).toDF("a") | ||
| df2 = self.spark.range(1).toDF("b") | ||
|
|
||
| try: |
Member
Author
There was a problem hiding this comment.
Other diff are basically the same.
Member
Author
|
cc @ueshin and @BryanCutler |
|
Test build #88404 has finished for PR 20863 at commit
|
Member
Author
|
Merged to branch-2.3. Thank you for reviewing this @ueshin. |
asfgit
pushed a commit
that referenced
this pull request
Mar 20, 2018
…where possible ## What changes were proposed in this pull request? This PR backports #20830 to reduce the diff against master and restore the default value back in PySpark tests. d6632d1 added an useful util. This backport extracts and brings this util: ```python contextmanager def sql_conf(self, pairs): ... ``` to allow configuration set/unset within a block: ```python with self.sql_conf({"spark.blah.blah.blah", "blah"}) # test codes ``` This PR proposes to use this util where possible in PySpark tests. Note that there look already few places affecting tests without restoring the original value back in unittest classes. ## How was this patch tested? Likewise, manually tested via: ``` ./run-tests --modules=pyspark-sql --python-executables=python2 ./run-tests --modules=pyspark-sql --python-executables=python3 ``` Author: hyukjinkwon <gurwls223@gmail.com> Closes #20863 from HyukjinKwon/backport-20830.
peter-toth
pushed a commit
to peter-toth/spark
that referenced
this pull request
Oct 6, 2018
…where possible ## What changes were proposed in this pull request? This PR backports apache#20830 to reduce the diff against master and restore the default value back in PySpark tests. apache@d6632d1 added an useful util. This backport extracts and brings this util: ```python contextmanager def sql_conf(self, pairs): ... ``` to allow configuration set/unset within a block: ```python with self.sql_conf({"spark.blah.blah.blah", "blah"}) # test codes ``` This PR proposes to use this util where possible in PySpark tests. Note that there look already few places affecting tests without restoring the original value back in unittest classes. ## How was this patch tested? Likewise, manually tested via: ``` ./run-tests --modules=pyspark-sql --python-executables=python2 ./run-tests --modules=pyspark-sql --python-executables=python3 ``` Author: hyukjinkwon <gurwls223@gmail.com> Closes apache#20863 from HyukjinKwon/backport-20830.
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 backports #20830 to reduce the diff against master and restore the default value back in PySpark tests.
d6632d1 added an useful util. This backport extracts and brings this util:
to allow configuration set/unset within a block:
This PR proposes to use this util where possible in PySpark tests.
Note that there look already few places affecting tests without restoring the original value back in unittest classes.
How was this patch tested?
Likewise, manually tested via: