diff options
| -rw-r--r-- | doc/build/changelog/unreleased_20/9717.rst | 8 | ||||
| -rw-r--r-- | lib/sqlalchemy/util/typing.py | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/doc/build/changelog/unreleased_20/9717.rst b/doc/build/changelog/unreleased_20/9717.rst new file mode 100644 index 000000000..d70ffe17a --- /dev/null +++ b/doc/build/changelog/unreleased_20/9717.rst @@ -0,0 +1,8 @@ +.. change:: + :tags: bug, orm + :tickets: 9717 + + Fixed issue where ORM Annotated Declarative would not resolve forward + references correctly in all cases; in particular, when using + ``from __future__ import annotations`` in combination with Pydantic + dataclasses. diff --git a/lib/sqlalchemy/util/typing.py b/lib/sqlalchemy/util/typing.py index 9c38ae344..3ac67aad9 100644 --- a/lib/sqlalchemy/util/typing.py +++ b/lib/sqlalchemy/util/typing.py @@ -146,7 +146,7 @@ def de_stringify_annotation( original_annotation = annotation - if is_fwd_ref(annotation) and not annotation.__forward_evaluated__: + if is_fwd_ref(annotation): annotation = annotation.__forward_arg__ if isinstance(annotation, str): |
