-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pydantic: uninformative error #385
Comments
This should be as simple as throwing the appropriate error message here |
Hi @elijahbenizzy can't I just simply add: state_model = type_hints.get("state", None) in line 115 of |
Yep, I think that will work. In fact, you don't have to have the |
Oh yes, thanks for reminding me that. Please let me know if state_model = type_hints.get("state")
if state_model is None or state_model is inspect.Parameter.empty or not issubclass(state_model, pydantic.BaseModel):
raise ValueError(
f"Function fn: {fn.__qualname__} is not a valid pydantic action. "
"The 'state' parameter must be annotated with a type extending pydantic.BaseModel."
) |
Hey @elijahbenizzy @zilto can anyone of you give me feedback on the |
Hey! Looks good at first glance. Open a PR and add some tests, then I can give you more feedback there! |
I'm building an application with
burr.integrations.pydantic
and building the graph + application fails. The following error message isn't helpful because it exposes internal implementation (i.e., the key"state"
is nowhere in my code.The only hint is to look at "line 45", but I can't tell what's the issue. I ended up finding that the issue is the function signature on line 46.
Original:
Fix:
The text was updated successfully, but these errors were encountered: