This is an automated email from the ASF dual-hosted git repository. github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-8742-f916c96c53d75c6661505bb804c9c80557b9d716 in repository https://gitbox.apache.org/repos/asf/texera.git
commit b76f51695f35fe57048b1b99703e0f1295b699da Author: Xinyuan Lin <[email protected]> AuthorDate: Wed Oct 21 05:45:50 2026 +0000 refactor(config): remove the unread UDF Python log settings (#8742) ### What changes were proposed in this PR? Removes the UDF Python log settings that nothing reads. **−30 lines.** There is no behaviour change. - `udf.conf`: the `python.log.fileHandler` section (`dir`, `level`, `format` and their `UDF_PYTHON_LOG_FILEHANDLER_*` overrides) and `python.log.streamHandler.format` (with `UDF_PYTHON_LOG_STREAMHANDLER_FORMAT`). - `UdfConfig`: `pythonLogStreamHandlerFormat`, `pythonLogFileHandlerDir`, `pythonLogFileHandlerLevel`, `pythonLogFileHandlerFormat`. The vals and the keys go together, because the vals' eager `getString` would throw once a key is gone. - `UdfConfigSpec`: the assertions for the removed settings. `python.log.streamHandler.level` stays. `PythonWorkflowWorker` forwards it as `loggerLevel`, and CI sets `UDF_PYTHON_LOG_STREAMHANDLER_LEVEL`. ### History | | | | --- | --- | | **Introduced by** | #1119 (2021-05-13), "Add simple debug logging to PythonUDF": the conf keys. #3466 (2025-06-12), "Move all conf files and readers to `core/config`": the `UdfConfig` vals | | **Usage removed by** | #1958 (2023-06-04), "Remove the deprecated Python UDF V1". It deleted the Java launcher that read these keys and attached the file handler. The `UdfConfig` vals were **never used** | The keys have been dead for over three years. The worker installs one stderr sink at the forwarded level and has never received a format or a file-handler setting since #1958. ### Any related issues, documentation, discussions? Closes #8741 ### How was this PR tested? No new tests. `UdfConfigSpec` keeps its cases for the surviving settings. Locally, from the repo root with Java 17: - `sbt "Config/Test/compile" "WorkflowExecutionService/Test/compile"`: success. - `sbt "Config/testOnly *UdfConfigSpec *PythonUtilsSpec"`: 4 tests, all pass. - `sbt "Config/scalafmtCheckAll" "Config/scalafixAll --check" "WorkflowExecutionService/scalafmtCheckAll" "WorkflowExecutionService/scalafixAll --check"`: clean. To re-check: ``` git grep -n -E "fileHandler|LOG_FILEHANDLER|STREAMHANDLER_FORMAT|pythonLogStreamHandlerFormat" # no hits ``` ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5.5) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- common/config/src/main/resources/udf.conf | 15 --------------- .../scala/org/apache/texera/common/config/UdfConfig.scala | 4 ---- .../org/apache/texera/common/config/UdfConfigSpec.scala | 11 ----------- 3 files changed, 30 deletions(-) diff --git a/common/config/src/main/resources/udf.conf b/common/config/src/main/resources/udf.conf index 7212d1720e..e783f5d003 100644 --- a/common/config/src/main/resources/udf.conf +++ b/common/config/src/main/resources/udf.conf @@ -25,21 +25,6 @@ python { # handler output level level="INFO" level = ${?UDF_PYTHON_LOG_STREAMHANDLER_LEVEL} - # handler log format - format= "<green>{time:YYYY-MM-DD HH:mm:ss.SSS}</green> | <level>{level: <8}</level> | <cyan>{name}</cyan>:<cyan>{function}</cyan>:<cyan>{line}</cyan> - <level>{message}</level>" - format = ${?UDF_PYTHON_LOG_STREAMHANDLER_FORMAT} - } - - fileHandler { - # log directory - dir= "/tmp/" - dir = ${?UDF_PYTHON_LOG_FILEHANDLER_DIR} - # handler output level - level= "INFO" - level = ${?UDF_PYTHON_LOG_FILEHANDLER_LEVEL} - # handler log format - format= "<green>{time:YYYY-MM-DD HH:mm:ss.SSS}</green> | <level>{level: <8}</level> | <cyan>{name}</cyan>:<cyan>{function}</cyan>:<cyan>{line}</cyan> - <level>{message}</level>" - format = ${?UDF_PYTHON_LOG_FILEHANDLER_FORMAT} } } } diff --git a/common/config/src/main/scala/org/apache/texera/common/config/UdfConfig.scala b/common/config/src/main/scala/org/apache/texera/common/config/UdfConfig.scala index e8f48d92c0..7cfd144f14 100644 --- a/common/config/src/main/scala/org/apache/texera/common/config/UdfConfig.scala +++ b/common/config/src/main/scala/org/apache/texera/common/config/UdfConfig.scala @@ -28,10 +28,6 @@ object UdfConfig { // Python specifics val pythonPath: String = conf.getString("python.path") val pythonLogStreamHandlerLevel: String = conf.getString("python.log.streamHandler.level") - val pythonLogStreamHandlerFormat: String = conf.getString("python.log.streamHandler.format") - val pythonLogFileHandlerDir: String = conf.getString("python.log.fileHandler.dir") - val pythonLogFileHandlerLevel: String = conf.getString("python.log.fileHandler.level") - val pythonLogFileHandlerFormat: String = conf.getString("python.log.fileHandler.format") // R specifics val rPath: String = conf.getString("r.path") diff --git a/common/config/src/test/scala/org/apache/texera/common/config/UdfConfigSpec.scala b/common/config/src/test/scala/org/apache/texera/common/config/UdfConfigSpec.scala index 5490268747..cdda93b7cb 100644 --- a/common/config/src/test/scala/org/apache/texera/common/config/UdfConfigSpec.scala +++ b/common/config/src/test/scala/org/apache/texera/common/config/UdfConfigSpec.scala @@ -38,16 +38,5 @@ class UdfConfigSpec extends AnyFlatSpec with Matchers { ifUnset("UDF_PYTHON_LOG_STREAMHANDLER_LEVEL")( UdfConfig.pythonLogStreamHandlerLevel shouldBe "INFO" ) - ifUnset("UDF_PYTHON_LOG_FILEHANDLER_DIR")(UdfConfig.pythonLogFileHandlerDir shouldBe "/tmp/") - ifUnset("UDF_PYTHON_LOG_FILEHANDLER_LEVEL")(UdfConfig.pythonLogFileHandlerLevel shouldBe "INFO") - } - - it should "resolve the non-empty log format strings" in { - ifUnset("UDF_PYTHON_LOG_STREAMHANDLER_FORMAT")( - UdfConfig.pythonLogStreamHandlerFormat should not be empty - ) - ifUnset("UDF_PYTHON_LOG_FILEHANDLER_FORMAT")( - UdfConfig.pythonLogFileHandlerFormat should not be empty - ) } }
