You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/09/05 02:30:00 UTC

[GitHub] [spark] HyukjinKwon commented on a diff in pull request #37777: [WIP][SPARK-40309][PYTHON][PS] Introduce `sql_conf` context manager for `pyspark.sql`

HyukjinKwon commented on code in PR #37777:
URL: https://github.com/apache/spark/pull/37777#discussion_r962431482


##########
python/pyspark/sql/utils.py:
##########
@@ -303,3 +304,31 @@ def is_timestamp_ntz_preferred() -> bool:
     """
     jvm = SparkContext._jvm
     return jvm is not None and jvm.PythonSQLUtils.isTimestampNTZPreferred()
+
+
+@contextmanager
+def sql_conf(pairs: Dict[str, Any], *, spark: Optional["SparkSession"] = None) -> Iterator[None]:

Review Comment:
   Should probably name it as `sqlConf` since we follow camelcase in the API. In addition, I think this should be able to be imported via something like `from pyspark.sql import sqlConf`. Should also document it in the API reference at `python/docs`



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