Closed tjader closed 11 months ago
I just found this closed (but as of now unreleased) issue. https://github.com/python-attrs/cattrs/issues/40
Yeah, can you give it a test with main
? The next release is very close.
Thanks - The issue has been solved in main already. Looking forward to the next release.
Description
SQLAlchemy 2.0 has a new integration with dataclasses (and to some extent attrs). It somewhat works with cattrs as well. However, cattrs doesn't detect the init=False flag on the mapped columns (i.e dataclass fields).
What I Did
Using the example in sqlalchemy's documentation (https://docs.sqlalchemy.org/en/20/orm/dataclasses.html#declarative-dataclass-mapping), you can try running structure on some data. This works if there is no init=False column
But fails, if we try to structure a class with a init=False field