kz930 opened a new pull request, #7234:
URL: https://github.com/apache/texera/pull/7234

   ### What changes were proposed in this PR?
   
   Dendrogram's Color Threshold could not be set at all:
   
   - the field was declared as a string and spliced into the generated Python 
as a decode expression, so scipy received `'3'` rather than `3` and raised 
`UFuncTypeError` comparing it against the linkage distances
   - the only values that plotted were a blank field and the literal `default`, 
and scipy documents those as equivalent — both mean 0.7 × max distance — so 
nothing a user could type ever changed the coloring
   
   This PR declares the field as `Option[Double]`:
   
   - the number is spliced as a literal, so scipy gets a number
   - an unset threshold stays `None`, the same 0.7 × max distance a blank field 
already meant
   - `@JsonDeserialize(contentAs = ...)` names the boxed class: Scala erases 
`Option`'s element type, so without it Jackson leaves the raw JSON value inside 
the Option and the first use throws `ClassCastException`, and the primitive 
class would read a blank as 0 — every link colored the same rather than "unset"
   
   Compatibility: a numeric string saved earlier still reads as a number, and 
those workflows were failing before this change anyway. A workflow that stored 
the literal `default` no longer loads; clearing the field plots the identical 
chart.
   
   ### Any related issues, documentation, discussions?
   
   Fixes #7232.
   
   ### How was this PR tested?
   
   - the operator's existing spec updated: a configured threshold is asserted 
to reach the template as `color_threshold=42.5`, not as a decoded string
   - deserialization tests for a JSON number, a numeric string, blank, null and 
absent — plus one that uses the value as a number, the case a round trip cannot 
catch
   - ran the generated Python against a pandas DataFrame: `color_threshold=3.0` 
plots a figure and so does the unset case, while passing the same value as a 
string, which is what the operator does today, raises `UFuncTypeError`
   - whole workflow-operator module: 2020 tests passing, `scalafmtCheck` clean
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (claude-opus-5[1m])
   


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

Reply via email to