Open kzeitz opened 8 months ago
I found a fix. Update your pydantic version to pydantic==1.10.8
I'll give that a try. Thanks!
Hey @kzeitz, I think you've found a gap in our pydantic v2 support logic. Based on your comment and original bug report, it looks like the issue is specifically when pydantic v2 is installed, is that right? While downgrading to pydantic v1 is the quickest fix, this is something that we want working on v2 too. We'll work on a fix for this.
Yes... you are correct. I was using pydantic 2.5.2 I believe.
I'm pleased that you plan on fixing it. I'll see if downgrading works for me in the meantime. I appreciate your attention to this.
I'm surprised this isn't also an error due to #7502. Just a head's up that there could be some relation.
Unrelated @kzeitz but I believe your reproduction has opened a [secret scanning alert] since your Databricks token was exposed (https://github.com/PrefectHQ/prefect/security/secret-scanning/2).
Edit: Revoked secret and closed alert.
Thanks...
First check
Bug summary
I was working on passing json to my deployment. I defined a pydantic schema that describes the json. One element of the schema is self referencing or recursive. If I define a flow function and pass the recursive type or any other type that includes the recursive type I get the error.
Reproduction
Error
Versions
Additional context
Sorry for the large json string...
I received the error originally when calling deployment.apply() as I'm trying to get better validation and parameter handling of the json string, as it is large and easy to get incorrect.
I removed the deploy code as the issue occurs with or without it.
Just changing the parameter type to a non-recursive type or directly to
BaseModel
, and the problem disappears.