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
AttributeError: 'NoneType' object has no attribute 'Config' #124
Comments
Thanks for opening an issue here. I won't be able to help you unless you provide some of the pydantic models that cause the error. Perhaps you can narrow it down. This would be of great help. More concretely, watch out for non standard models (e g. Multiple inheritance). If your repository is public, I can have a look myself. |
So I narrowed it down to this model: # Affine.py
import affine as _affine
import pydantic
class Affine(pydantic.BaseModel):
a: float
b: float
c: float
d: float
e: float
f: float
@classmethod
def from_affineAffine(cls, _affine: _affine.Affine):
return cls(
a=_affine.a, b=_affine.b, c=_affine.c, d=_affine.d, e=_affine.e, f=_affine.f
) Which confuses me as it's not even a complex model at that, and works flawlessly in my code and tests. |
Okay I think I've narrowed it down. When I change the name to anything other than I do have another data model called
|
Thanks for providing more information on this. I took a closer look at it and it seems as if |
Here are my two # src/project/Types/db/Affine.py
from project.Types import Affine as pd_Affine
import affine as _affine
from sqlalchemy import Column
from sqlalchemy import Float
from sqlalchemy import Integer
from .BaseModel import _BaseModel
class Affine(_BaseModel):
__tablename__ = "affine"
__table_args__ = {"extend_existing": True}
id = Column(Integer, primary_key=True)
a = Column(Float(32))
b = Column(Float(32))
d = Column(Float(32))
e = Column(Float(32))
xoff = Column(Float(32))
yoff = Column(Float(32))
@classmethod
def from_affineAffine(cls, _affine: _affine.Affine):
affine = cls()
affine.a = _affine.a
affine.b = _affine.b
affine.d = _affine.d
affine.e = _affine.e
affine.xoff = _affine.c
affine.yoff = _affine.f
return affine
# src/project/Types/Affine.py
import affine as _affine
import pydantic
class Affine(pydantic.BaseModel):
a: float
b: float
c: float
d: float
e: float
f: float
@classmethod
def from_affineAffine(cls, _affine: _affine.Affine):
return cls(
a=_affine.a, b=_affine.b, c=_affine.c, d=_affine.d, e=_affine.e, f=_affine.f
) |
This bug is addressed via #131. Before merging the related PR, it would be great if you could test the bugfix on your site. To do so, please install the current dev release in your doc-building-environment via I'm not 100% sure if it fixes your problem because I couldn't reproduce the error given your example. It would require me to investigate your settings in more detail. But #129 had the same error traceback and it wouldn't surprise me if this also applies to your case. |
@all-contributors please add @iwishiwasaneagle for bug |
I've put up a pull request to add @iwishiwasaneagle! 🎉 |
@mansenfranzen Changed to |
autodoc_pydantic failing builds without much information or which model is causing the issue.
Full log
The text was updated successfully, but these errors were encountered: