majiayu000 commented on PR #614:
URL: https://github.com/apache/burr/pull/614#issuecomment-3699714026

   ## Before and After Example
   
   ### Before (without this fix)
   
   ```python
   from burr.integrations.pydantic import pydantic_action
   
   @pydantic_action
   def my_action(state):  # missing type annotation
       return state
   ```
   
   **Error:**
   ```
   KeyError: 'state'
   ```
   
   This error is cryptic and doesn't tell the user what went wrong.
   
   ---
   
   ### After (with this fix)
   
   ```python
   from burr.integrations.pydantic import pydantic_action
   
   @pydantic_action
   def my_action(state):  # missing type annotation
       return state
   ```
   
   **Error:**
   ```
   ValueError: The 'state' parameter must be annotated with a type extending 
pydantic.BaseModel.
   ```
   
   Now the error message clearly explains what the user needs to fix.


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