-
-
Notifications
You must be signed in to change notification settings - Fork 31
[BUG] pandera model wrongly detected as pydantic and pytkdocs tries to read non existent attributes #148
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
Comments
Hello, thanks for the report. Do you use the legacy handler by necessity? Out of curiosity, is there something preventing you from using the new handler? |
Hi @pawamoy, thanks for pointing out that we are using a legacy handler. I guess there was a phase where our docs were not supported yet so I kept working with mkdocstrings[python-legacy]. |
That would be great if you could report these issues you get indeed. If your repo is public, I can also use it to investigate (this way you don't need to create a minimal example). I bet the index errors come from how we parse Returns section in docstrings. Try indenting continuation lines once more:
->
Unless you're not using Google docstrings? |
That worked indeed. At least there are no runtime errors anymore. |
Still the best approach, yes. And you can use |
Great. Thanks for pointing that out. It worked just fine. |
Yes, these are known issues and we plan to alleviate them. Note that wildcard imports make the situation worse, I recommend avoiding them. |
First of all, thanks for developing pytkdocs!
I do not use pytkdocs directly, but rather mkdocs and mkdocstrings which call pytkdocs.
Here is an example for reproduction.
Without any instantiated code (that actually uses the panderas models) it runs just fine. But, as soon as I USE the models somewhere in some precomputed objects pytkdocs runs into the following errors:
It seems these pandera models are detected as pydantic, but they do not have the same attributes.
For proper pydantic classes we have this:
For pandera models we seem to have this
pytkdocs 0.16.1, python 3.10.7, Linux
pydantic 1.10.11 with pydantic_core 2.1.2 (pandera imposes a restriction of pydantic <2)
pandera 0.15.2
The text was updated successfully, but these errors were encountered: