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

   ### What changes were proposed in this PR?
   
   This makes Python UDF mistakes explain themselves, and rewrites the user 
docs for people who aren't programmers. The motivating case, from the UMich 
team, is in #8736.
   
   **UDF templates** (Python UDF, 2-in, 1-out)
   - `from pytexera import *` is no longer commented out, so uncommenting one 
class gives a working UDF.
   - A short header says: keep one class, which method goes with which base 
class, `yield` not `return`, and `open()` / `super().__init__()`.
   - The UiParameter lines are kept. Saved workflows keep their own code.
   
   **Load errors** (`executor_manager.py`)
   
   The old "There should be one and only one Operator defined" sentence stays 
first, then the message says what to fix:
   
   | Mistake | Message now adds |
   |---|---|
   | No class | `No Operator class was found. Uncomment or write exactly one 
class...` |
   | Wrong method for the base | `WrapperClass subclasses UDFOperatorV2 but 
does not implement process_tuple. If you meant process_table, subclass 
UDFTableOperator instead.` |
   | Two classes | `Found 2: FirstOperator, SecondOperator. Keep one...` |
   | Missing import | `name 'UDFOperatorV2' is not defined (line 2 of the UDF 
code). Add from pytexera import * at the top of the UDF.` |
   | Any other load error | the line number in the user's code |
   
   **Runtime errors** (`operator.py`, `data_processor.py`)
   - `return` instead of `yield` now says `process_table must yield results, 
not return them` instead of `MatchError` / `'NoneType' object is not iterable`. 
Returning a list still works.
   - Table and batch buffers are created lazily, so a missing 
`super().__init__()` no longer crashes with `'_TableOperator__table_data'`. 
`Operator` already does this for its template decoder.
   - Yielding a dict of DataFrames, or columns that don't match the output 
schema, now points to the fix.
   
   **Frontend**
   - The Kill button has a tooltip.
   - The empty Result panel now says: "Click an operator to see its results and 
Console. Click an empty spot on the canvas to see errors from all operators." 
Startup errors only show in the Static Error tab when nothing is selected, and 
users don't find that.
   
   **Computing unit quota error** now adds: "Reuse one of your running 
computing units, or terminate one you no longer need."
   
   **Docs**
   - Rewritten: the Python UDF guide (a first example, the 5 rules, and a table 
mapping each error to its fix), the "how to use Texera" guide (colors, where 
errors show, a stuck-workflow checklist), and the dataset tutorial. The old 
dataset tutorial pointed to an `environment` tab that no longer exists, and its 
sample CSV link returned 404.
   - New pages: Computing Units, Sharing and Permissions, and How Texera Runs 
Your Workflow (blocking operators, regions).
   - Screenshots are from the current UI. The pages that have images became 
folders (`page/index.md` with the images next to it), so the URLs stay the same.
   
   The commits are split by area if you'd rather review them one at a time.
   
   ### Any related issues, documentation, discussions?
   
   Closes #8736
   
   Related: #8667 / #8668 fix the silent hang on UDF setup failures. Once that 
lands, users will see these messages.
   
   ### How was this PR tested?
   
   Every behavior change has a test written first.
   
   - Python: new tests in `test_executor_manager.py`, `test_operator.py` and 
`test_data_processor.py`. Full suite: `cd amber && pytest -m "not integration"` 
gives 1349 passed. ruff check and format are clean.
   - Scala: new specs for all three templates, which read the `defaultValue` 
and check that uncommenting any one class leaves exactly one active class. The 
quota message spec is updated. Checked with `WorkflowOperator/testOnly 
...udf.python.*`, `ComputingUnitManagingService/testOnly 
...ComputingUnitManagingServiceExceptionSpec`, and scalafmtCheck.
   - Frontend: new specs in `result-panel.component.spec.ts` and 
`menu.component.spec.ts` (197 passed), plus prettier and eslint.
   - Docs: a separate reviewer followed every tutorial in a local Texera as a 
first-time user. The dataset tutorial reproduced the screenshot numbers (100 → 
23 → 6), and the steps it tripped on are fixed in the last commit.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Claude Opus 5.5)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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