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-7214-1dc78e9b1a619b0802f25b6717c1c00f5dd39f87 in repository https://gitbox.apache.org/repos/asf/texera.git
commit af8cec2e2cccab5ad35be68c1de901a31c9b79f0 Author: Prateek Ganigi <[email protected]> AuthorDate: Sun Aug 2 20:35:33 2026 -0700 fix(workflow-operator): add missing defaultValue to HF temperature property (#7214) ### What changes were proposed in this PR? The temperature field's default (0.7) and valid range weren't advertised in the operator's JSON schema. It can't be done with @JsonProperty(defaultValue = "0.7"): the schema generator (mbknor jackson-jsonSchema) parses a numeric field's defaultValue with .toInt, so a floating-point value throws NumberFormatException and breaks operator-metadata generation, which is why "0.7" was the only float defaultValue in the repo. Instead this uses @JsonSchemaInject (the pattern already used for Double fields in RadarChartOpDesc/ScatterplotOpDesc), injecting { "minimum": 0.0, "maximum": 2.0, "default": 0.7 } to match the field's runtime clamp and description. ### Any related issues, documentation, discussions? Closes #7201. ### How was this PR tested? sbt "WorkflowOperator/testOnly org.apache.texera.amber.operator.huggingFace.* org.apache.texera.amber.operator.metadata.*", the Hugging Face suite plus the operator-metadata specs pass (147 tests), including PythonCodeRawInvalidTextSpec (py-compiles every operator's generated Python) and the schema-generation path this change touches. scalafmt clean. Schema-metadata-only change: it doesn't affect the generated Python or any runtime behavior, so no new test was added. ### Was this PR authored or co-authored using generative AI tooling? No, this PR wasn't authored or co-authored using generative AI tooling. --- .../texera/amber/operator/huggingFace/HuggingFaceInferenceOpDesc.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/huggingFace/HuggingFaceInferenceOpDesc.scala b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/huggingFace/HuggingFaceInferenceOpDesc.scala index 6599625ddf..590b509787 100644 --- a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/huggingFace/HuggingFaceInferenceOpDesc.scala +++ b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/huggingFace/HuggingFaceInferenceOpDesc.scala @@ -146,6 +146,7 @@ class HuggingFaceInferenceOpDesc extends PythonOperatorDescriptor { @JsonProperty(value = "temperature", required = false) @JsonSchemaTitle("Temperature") @JsonPropertyDescription("Sampling temperature (0.0 = deterministic, up to 2.0)") + @JsonSchemaInject(json = """{ "minimum": 0.0, "maximum": 2.0, "default": 0.7 }""") var temperature: java.lang.Double = 0.7 @JsonProperty(
