Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-50427][CONNECT][PYTHON] Expose configure_logging as a public API
### What changes were proposed in this pull request? Expose `configure_logging` as a public API that can be used to configure the log level for Pyspark connect component. ### Why are the changes needed? We currently offer the mechanism to configure the connect-specific logger based on the environment variable `SPARK_CONNECT_LOG_LEVEL`. The logger is configured once at the the time of "module load". In some cases, Python frameworks (eg. IPythonKernel) can modify the Python log level after the fact leading to unintended log output. There is no good way to restore the logger to restore its previous functionality to honor the environment variable configured. ### Does this PR introduce _any_ user-facing change? Yes. Provide a new API `configure_logging` in the module `pyspark.sql.connect.logging`. ### How was this patch tested? Local testing by calling `configure_logging` with different log levels. Further tested with IPythonKernel instance which changes the log level and confirmed that calling this API during app startup fixes it back to the correct log level. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #48802 from nija-at/expose-log-method. Authored-by: Niranjan Jayakar <[email protected]> Signed-off-by: Hyukjin Kwon <[email protected]>
- Loading branch information