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

   ### What changes were proposed in this PR?
   
   `isSink` and `isPythonUdf` in `workflow-graph.ts` both gate real behavior 
but had no test coverage:
   
   - `isSink` decides which operators the result panel renders, and which ones 
the operator menu allows caching for.
   - `isPythonUdf` decides whether the console is displayed and whether the UDF 
parameter sync runs.
   
   The two helpers use deliberately different matching rules, and this PR pins 
both down:
   
   ```ts
   isSink       // case-insensitive substring match on "sink"
   isPythonUdf  // exact membership in the three V2 UDF type constants
   ```
   
   Two consequences of those rules are asserted explicitly, since both are easy 
to misread at a call site:
   
   1. Because `isSink` matches on a substring rather than an anchored suffix, 
an unrelated operator whose type merely *contains* "sink" is reported as a 
sink. The test records this rather than leaving it to be rediscovered.
   2. `"PythonUDF"` — the legacy non-V2 type, already present in the mock 
fixtures as `mockPythonUDFPredicate` — is **not** a Python UDF according to 
`isPythonUdf`, which matches only `PythonUDFV2`, `PythonUDFSourceV2` and 
`DualInputPortsPythonUDFV2`.
   
   No production code is changed; this is a test-only PR.
   
   ### Any related issues, documentation, discussions?
   
   Closes #6674
   
   ### How was this PR tested?
   
   Ten cases were added to the existing `workflow-graph.spec.ts`, in two new 
`describe` blocks, reusing the existing mock fixtures and a small 
`operatorOfType` helper for the synthetic type names.
   
   | Helper | Cases |
   | --- | --- |
   | `isSink` | view-result operator is a sink; scan/sentiment/UDF operators 
are not; case-insensitivity across 
`Sink`/`sink`/`SINK`/`CsvFileSink`/`sinkOperator`; substring looseness 
(`SinkholeDetector`); near-miss types (`Sin`, `Ink`, `Snik`, `""`) |
   | `isPythonUdf` | all three V2 constants match; legacy `PythonUDF` does not; 
`JavaUDF`/scan/result do not; exact-match rule holds against wrong case and 
superstrings |
   
   ```
   npx ng test --watch=false --include="**/workflow-graph.spec.ts"
   # Test Files  1 passed (1)
   #      Tests  78 passed (78)     <- 68 existing + 10 added here
   ```
   
   `npx prettier --check` reports no diff on the changed file.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Yes, partially. I (Suyash Jain) worked on this PR together with Claude Code 
as a pair-programming assistant. The added specs were run locally against the 
existing suite before opening this PR.
   
   Generated-by: Claude Code (Claude Opus 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