Matthew-DWM opened a new pull request, #9563:
URL: https://github.com/apache/texera/pull/9563

   ### What changes were proposed in this PR?
   
   Reservoir Sampling's sample size k had no lower bound in its schema, so the 
property editor accepted 0 or a negative number and let the workflow run. The 
engine refuses a sample size below 1 at the first row, but the refusal pauses 
the worker, so the run stays Running until it is killed. k now declares 
`minimum: 1`, so the editor rejects such a value before the run starts.
   
   ```
   Before:  k = 0 typed in  ->  form valid, Run enabled  ->  Reservoir Sampling 
stays Running
   After:   k = 0 typed in  ->  "must be >= 1"            ->  Invalid Workflow, 
Run disabled
   ```
   
   The check runs in the editor only. A value set through the API, an imported 
workflow or a loop variable still reaches the engine, which refuses it at the 
first row as before. Inside a loop, k can still hold a loop variable such as 
`$i`, since the bound applies only to numbers.
   
   ### Any related issues, documentation, discussions?
   
   Closes #9506
   
   ### How was this PR tested?
   
   A new test in `ReservoirSamplingOpDescSpec` checks k = -1, 0, 1 and 5 
against the generated schema, using the same validator as 
`ScanSourceOpDescSpec`. It fails on `main`, where the schema accepts -1, and 
passes with this change.
   
   The editor's validator (ajv 8.18.0, set up as in 
`ValidationWorkflowService`) was also run on the schema before and after:
   - k = 0 and k = -1 go from valid to "must be >= 1"; 1 and 5 stay valid.
   - A new operator with k left empty still shows "required".
   
   ```
   sbt "WorkflowOperator/testOnly *ReservoirSampling*"                   # 19 
passed
   AMBER_TEST_FILTER=skip-integration sbt WorkflowOperator/jacoco         # 
2,994 passed
   AMBER_TEST_FILTER=integration-only sbt WorkflowOperator/test           # 85 
passed
   sbt "WorkflowExecutionService/testOnly *SystemMetadataResourceSpec"    # 2 
passed
   sbt OperatorReferenceGenerator/test                                    # 19 
passed
   ```
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Claude Opus 5.5)
   


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