diff options
author | Federico Caselli <cfederico87@gmail.com> | 2022-11-26 19:24:49 +0100 |
---|---|---|
committer | Federico Caselli <cfederico87@gmail.com> | 2022-11-26 19:25:37 +0100 |
commit | 25c2b7dd105a6622eff2c7631d3c2d6eb978dc1f (patch) | |
tree | 46ae527de593ddcbfcf115ca7d61edad9aa083b5 /lib/sqlalchemy/orm/properties.py | |
parent | 34e29f7b225cf1305e151af9d03ef95f42a9dbcc (diff) | |
download | sqlalchemy-25c2b7dd105a6622eff2c7631d3c2d6eb978dc1f.tar.gz |
Add new script to sync test files adding future annotation
Create a new test file test_tm_future_annotations_sync.py that's obtained
from test_tm_future_annotations.py by using the new script sync_test_files.
This files includes the ``from __future__ import annotations``
It also turns out we had some bugs in there and we can also support some
additional typing things
Change-Id: Iac005df206d45a55345d9d88d67a80ce799d449f
Diffstat (limited to 'lib/sqlalchemy/orm/properties.py')
-rw-r--r-- | lib/sqlalchemy/orm/properties.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/properties.py b/lib/sqlalchemy/orm/properties.py index b8e1521a2..e89e3c356 100644 --- a/lib/sqlalchemy/orm/properties.py +++ b/lib/sqlalchemy/orm/properties.py @@ -684,7 +684,9 @@ class MappedColumn( ) -> None: sqltype = self.column.type - if is_fwd_ref(argument, check_generic=True): + if isinstance(argument, str) or is_fwd_ref( + argument, check_generic=True + ): assert originating_module is not None argument = de_stringify_annotation( cls, argument, originating_module, include_generic=True |