aglinxinyuan opened a new issue, #7826:
URL: https://github.com/apache/texera/issues/7826

   ### Describe the bug
   
   `WorkflowCompilingService.setOperatorInputAttrs` → `getAttrNames` 
(`workflow-compiling.service.ts`, around line 362) decides whether an 
autofilled property is required by consulting the **root** schema:
   
   ```ts
   operatorSchema.jsonSchema.required?.includes(attrName)
   ```
   
   But `DynamicSchemaService.mutateProperty` recurses into nested `properties` 
/ `items` / `definitions` (`dynamic-schema.service.ts:181`, `:188`, `:203`), 
and its callbacks only received `(propertyName, propertyValue)` — the owning 
object schema was never passed down. So a property nested inside a list element 
is tested against the root's `required` array, which does not describe it.
   
   **Concrete production case:** `SortOpDesc` + `SortCriteriaUnit`. The root 
requires `attributes`; each element declares `@JsonProperty(value = 
"attribute", required = true)` with `@AutofillAttributeName`. Root `required` 
is `["attributes"]`, so `"attribute"` is not found there and an empty option is 
appended — offering a blank sort key that `SortOpDesc.generatePythonCode` then 
rejects at code-generation time (`require(attributes.forall(...))`) rather than 
at form validation.
   
   The mirror case is the `aggregations[].attribute` shape, where `attribute` 
is legitimately optional per element (a COUNT(*) needs no column): a root-level 
required property sharing that name would silently strip its empty option.
   
   Note this also affects the `$ref` + `definitions` path, which is the shape 
the metadata generator actually emits — 
`OperatorMetadataGenerator.texeraSchemaGeneratorConfig` on 
mbknor-jackson-jsonSchema places nested types under root `definitions`.
   
   ### How to reproduce?
   
   Open a Sort operator's property editor: the autofilled `attribute` on each 
sort criterion offers a blank option even though it is declared `required = 
true`.
   
   ### Version/Branch
   
   main
   
   ### Task Type
   
   - [ ] Refactor / Cleanup
   - [ ] DevOps / Deployment / CI
   - [ ] Testing / QA
   - [ ] Documentation
   - [ ] Performance
   - [x] Other
   


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