attrs integration example in docs fails with forward reference error #12449
|
The attrs integration example in the documentation fails to run due to a forward reference issue. Using List["Address"] in the User class still results in a NameError. You can find the code here. Just copy, paste and run the code. The error will jump out. Error message:
EnvironmentSQLAlchemy 2.0.39 |
Replies: 1 comment 6 replies
|
hmm yup so that example was made for the 1.4 version of SQLAlchemy and it's been broken for the entirety of the 2.0 series when we started parsing There's no workaround for this that I can think of right now, unless we established some new flag that entirely turns off declarative's parsing of annotations. So unfortunately I'm going to just remove this example from the docs right now, since this is not really usable. We continue to have full support for mapping to existing dataclasses. But because we have no continuous testing for attrs integration, this feature simply broke and nobody noticed, therefore it's not appropriate to be documented since we are clearly not supporting it. |
I will update the docs to remove "attrs with declarative" since this has not worked for all of 2.0. imperative mappings can still be used.