What happened?
DendrogramOpDesc.createDendrogram interpolates the Color Threshold field straight into scipy's color_threshold argument. The field is an EncodableString, so what the template renders is a decode expression, and the value reaching scipy at run time is a Python string. scipy compares it against the linkage distances, which are float64, and numpy refuses. Every non-empty Color Threshold therefore fails, whatever is typed; leaving the field empty takes the color_threshold=None branch instead, which is why this has gone unnoticed.
Expected: a numeric threshold colours the clusters joined below that linkage distance.
Generated by generatePythonCode() for a threshold of 1.5 (MS41 is its base64):
fig = ff.create_dendrogram(data, labels=labels, color_threshold=self.decode_python_template('MS41'))
Executing that generated module unmodified — only the pytexera import seam stubbed, decode_python_template doing the real base64 decode — against a five-row frame crashes. With the field left empty the same flow emits color_threshold=None and produces the chart.
Straight against ff.create_dendrogram on plotly 5.24.1 and scipy 1.18.0, the pinned versions:
color_threshold |
result |
None — field empty |
renders |
'1.5' — string, what the operator emits today |
UFuncTypeError |
1.5 — number |
renders |
'default' — scipy's own 0.7 × max distance |
renders |
plotly passes the value through untouched, so a fix belongs on the Texera side. It should convert with Python's float() and fall back to the original string rather than casting unconditionally, so that "default" keeps working.
How to reproduce?
- Chain any source carrying two numeric columns and a label column into Dendrogram.
- Set Value X Column, Value Y Column and Labels.
- Put
1.5 in Color Threshold and run — the operator fails with the error below.
- Clear Color Threshold and run the same workflow — it succeeds.
Version/Branch
1.3.0-incubating-SNAPSHOT (main)
Relevant log output
UFuncTypeError: ufunc 'greater_equal' did not contain a loop with signature matching types
(<class 'numpy.dtypes.Float64DType'>, <class 'numpy.dtypes.StrDType'>) -> None
What happened?
DendrogramOpDesc.createDendrograminterpolates the Color Threshold field straight into scipy'scolor_thresholdargument. The field is anEncodableString, so what the template renders is a decode expression, and the value reaching scipy at run time is a Python string. scipy compares it against the linkage distances, which are float64, and numpy refuses. Every non-empty Color Threshold therefore fails, whatever is typed; leaving the field empty takes thecolor_threshold=Nonebranch instead, which is why this has gone unnoticed.Expected: a numeric threshold colours the clusters joined below that linkage distance.
Generated by
generatePythonCode()for a threshold of1.5(MS41is its base64):Executing that generated module unmodified — only the
pytexeraimport seam stubbed,decode_python_templatedoing the real base64 decode — against a five-row frame crashes. With the field left empty the same flow emitscolor_threshold=Noneand produces the chart.Straight against
ff.create_dendrogramon plotly 5.24.1 and scipy 1.18.0, the pinned versions:color_thresholdNone— field empty'1.5'— string, what the operator emits today1.5— number'default'— scipy's own 0.7 × max distanceplotly passes the value through untouched, so a fix belongs on the Texera side. It should convert with Python's
float()and fall back to the original string rather than casting unconditionally, so that"default"keeps working.How to reproduce?
1.5in Color Threshold and run — the operator fails with the error below.Version/Branch
1.3.0-incubating-SNAPSHOT (main)
Relevant log output