cdkrot commented on code in PR #42175:
URL: https://github.com/apache/spark/pull/42175#discussion_r1276026310
##########
python/pyspark/sql/connect/client/core.py:
##########
@@ -114,6 +115,19 @@ def _configure_logging() -> logging.Logger:
logger = _configure_logging()
+def spark_connect_log_level() -> Optional[int]:
+ """
+ This returns this log level as integer, or none (if no logging is enabled).
+
+ Spark Connect logging can be configured with environment variable
'SPARK_CONNECT_LOG_LEVEL'
+ .. versionadded:: 3.5.0
+ """
+
+ if logger.disabled:
+ return None
+ return logger.level
Review Comment:
Need return statement for codestyle:
```
annotations failed mypy checks:
python/pyspark/sql/connect/client/core.py:118: error: Missing return
statement [return]
```
##########
python/pyspark/sql/connect/client/core.py:
##########
@@ -104,7 +105,7 @@ def _configure_logging() -> logging.Logger:
# Check the environment variables for log levels:
if "SPARK_CONNECT_LOG_LEVEL" in os.environ:
- logger.setLevel(os.getenv("SPARK_CONNECT_LOG_LEVEL", "error").upper())
Review Comment:
Note original version has a typo, the default value is never used due to
above 'if'. I'm just removing the typo without changing the logic
--
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]