kunwp1 opened a new pull request, #5294:
URL: https://github.com/apache/texera/pull/5294

   ## Summary
   
   Fixes #3070: copy-pasting a schema-propagated **Aggregate** operator and 
connecting it to a *different* upstream operator caused a compile error that 
persisted **even after clearing all properties**.
   
   ### Root cause
   An Aggregate stores property values that reference input column names: 
`groupByKeys` (`@AutofillAttributeNameList`) and `aggregations[].attribute` 
(`@AutofillAttributeName`). Copy-paste clones `operatorProperties` verbatim, so 
the pasted operator kept references to the *old* source's columns. When wired 
to a different operator, the backend `AggregateOpDesc` schema propagation does 
`inputSchema.getAttribute("<old col>")`, which throws.
   
   These stale values were never removed — 
`DynamicSchemaService.setDynamicSchema` was *documented* to drop properties 
invalidated by a new schema, but the code never actually did it. The property 
editor only flagged the value as "no longer a valid option", so the error stuck.
   
   ### Fix
   When schema propagation produces an authoritative input-attribute list, 
`WorkflowCompilingService` now drops the property values the new schema 
invalidates, via a new pure helper `dropInvalidAttributeValues`:
   - `autofill: "attributeName"` → reset to `""` if not in the enum
   - `autofill: "attributeNameList"` → filter out entries not in the enum
   - recurses through nested objects/arrays (so `aggregations[].attribute` is 
handled), and never mutates the input
   
   It only acts when the input schema (enum) is known, so it's a no-op for 
source operators / disconnected operators and converges without a recompile 
loop. This also covers re-wiring any autofill operator to a new source, not 
just copy-paste. The misleading doc comment on `setDynamicSchema` now points to 
where the contract is fulfilled.
   
   ## Test plan
   - [x] `npx tsc --noEmit` is clean
   - [x] New unit test `workflow-compiling.service.spec.ts` (3 cases: invalid 
values dropped, valid values untouched, no-op when enum unknown) passes via `ng 
test`
   - [ ] Manual UI check: configure an Aggregate on source A, copy-paste it, 
wire the copy to a different source B → operator reverts to "needs column" 
instead of showing a stuck error


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