AnzhiZhang commented on code in PR #4006:
URL: https://github.com/apache/texera/pull/4006#discussion_r2478826429


##########
common/workflow-operator/src/main/scala/org/apache/amber/operator/visualization/dumbbellPlot/DumbbellPlotOpDesc.scala:
##########
@@ -46,34 +47,39 @@ class DumbbellPlotOpDesc extends PythonOperatorDescriptor {
   @JsonSchemaTitle("Category Column Name")
   @JsonPropertyDescription("the name of the category column")
   @AutofillAttributeName
+  @NotNull(message = "Category Column Name cannot be empty")
   var categoryColumnName: String = ""
 
   @JsonProperty(value = "dumbbellStartValue", required = true)
   @JsonSchemaTitle("Dumbbell Start Value")
   @JsonPropertyDescription("the start point value of each dumbbell")
+  @NotBlank(message = "Dumbbell Start Value cannot be empty")
   var dumbbellStartValue: String = ""
 
   @JsonProperty(value = "dumbbellEndValue", required = true)
   @JsonSchemaTitle("Dumbbell End Value")
   @JsonPropertyDescription("the end value of each dumbbell")
+  @NotBlank(message = "Dumbbell End Value cannot be empty")
   var dumbbellEndValue: String = ""
 
   @JsonProperty(value = "measurementColumnName", required = true)
   @JsonSchemaTitle("Measurement Column Name")
   @JsonPropertyDescription("the name of the measurement column")
   @AutofillAttributeName
+  @NotNull(message = "Measurement Column Name cannot be empty")
   var measurementColumnName: String = ""
 
   @JsonProperty(value = "comparedColumnName", required = true)
   @JsonSchemaTitle("Compared Column Name")
   @JsonPropertyDescription("the column name that is being compared")
   @AutofillAttributeName
+  @NotNull(message = "Compared Column Name cannot be empty")
   var comparedColumnName: String = ""
 
   @JsonProperty(value = "dots", required = false)
   var dots: util.List[DumbbellDotConfig] = _
 
-  @JsonProperty(value = "showLegends", required = false)
+  @JsonProperty(value = "showLegends", required = false, defaultValue = 
"false")

Review Comment:
   If there is no default value, the checkbox will show as in the screenshot 
below and cannot pass validation for those required not null values e.g., 
[here](https://github.com/apache/texera/pull/4006/files/6ef53bdcfd1e5d5bdbd7fdce4919cb607ec50bc6#diff-f5b809cf4ad004d9fc1c9e64f77ba5f88d2eaef72dc856ba9123891708886b74R61).
 Users will be confused by them and have no idea what to edit. The value set on 
value does not work, so we add a default value by `defaultValue`.
   
   <img width="966" height="1094" alt="image" 
src="https://github.com/user-attachments/assets/02043b10-4541-49d2-aba3-bfa0bc1f5516";
 />
   



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