carloea2 commented on code in PR #8346:
URL: https://github.com/apache/texera/pull/8346#discussion_r4079827053
##########
common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/polarChart/PolarChartOpDesc.scala:
##########
@@ -125,4 +129,34 @@ class PolarChartOpDesc extends PythonOperatorDescriptor {
|"""
finalCode.encode
}
+
+ override def producesDataFrame(): Boolean = false
+
+ override def generateStandaloneCode(): String = {
+ val rLit = pyStringLiteral(r)
+ val thetaLit = pyStringLiteral(theta)
+ s"""import numpy as np
+ |
+ |if in1df is None or in1df.empty:
+ | with open(outputHtml, "w", encoding="utf-8") as output:
+ | output.write('<h3>No data available for Polar Chart</h3>')
+ |elif $rLit not in in1df.columns or $thetaLit not in in1df.columns:
+ | with open(outputHtml, "w", encoding="utf-8") as output:
+ | output.write('<h3>Selected columns not found in input
table</h3>')
+ |elif not np.issubdtype(in1df[$rLit].dtype, np.number) or not
np.issubdtype(in1df[$thetaLit].dtype, np.number):
Review Comment:
Arrow Source emits nullable numeric dtypes. With r=[1,2] and theta=[0,90]
read from Feather, this raises TypeError because np.issubdtype cannot interpret
Int64Dtype. The same chart renders with ordinary NumPy integer columns. Please
use a numeric dtype check that accepts pandas nullable types.
--
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]