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

   ### What changes were proposed in this PR?
   
   When a Python UDF fails to load, the error now says what to fix. The 
existing "There should be one and only one Operator defined" sentence stays 
first, so anything matching on it still works.
   
   | Mistake | Message now adds |
   |---|---|
   | No class (e.g. the whole template left commented out) | `No Operator class 
was found. Uncomment or write exactly one class...` |
   | Method doesn't match the base class | `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 and delete 
or comment out the others.` |
   | Missing `from pytexera import *` | `name 'UDFOperatorV2' is not defined 
(line 2 of the UDF code). Add from pytexera import * at the top of the UDF.` |
   | `@overrides` on the wrong method | the base class to method pairing |
   | Any other load error | the line number in the user's code |
   
   Before and after, in the Static Error tab. Before is the untouched template; 
after is a class with the wrong method:
   
   | Before | After |
   |---|---|
   | `[upload: load-before.png]` | `[upload: load-after.png]` |
   
   Missing import, after:
   
   `[upload: load-after-import.png]`
   
   ### Any related issues, documentation, discussions?
   
   Part of #8736. Split out of #8737 as the reviewer asked.
   
   ### How was this PR tested?
   
   New tests in `test_executor_manager.py` cover each case above, plus a syntax 
error, a runtime error at load time, and the two fallbacks (an error with 
nothing to add, and an error type that can't be rebuilt with a new message). 
`cd amber && pytest -m "not integration"` passes, and ruff check and format are 
clean. The screenshots are from a local Texera built from this change.
   
   ### 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