fix(dendrogram, v1.2): pass the color threshold to scipy as a number - #7291
Closed
github-actions[bot] wants to merge 1 commit into
Closed
Conversation
### 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? (backported from commit 351ce20) Generated-by: Claude Code (claude-opus-5[1m])
Contributor
Author
|
The cherry-pick conflicted and was committed with conflict markers. Resolve the conflicts on this branch, then mark this PR ready for review. Conflicting files:
|
Contributor
|
@kz930 can you take care of this PR? |
Contributor
|
The cherry-pick conflict is resolved, but the branch lives in this repository and I do not have push access, so I opened #7306 from my fork with the resolved commit. Feel free to close this one. |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this PR?
Automated backport of #7234 to
release/v1.2.Source: 351ce20 · automation run
Any related issues, documentation, discussions?
Backport of #7234. Originally linked #7232.
How was this PR tested?
Release-branch CI runs on this branch once the conflicts are resolved and this PR is marked ready for review.
Was this PR authored or co-authored using generative AI tooling?
No.