summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/mapper.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2022-04-10 15:42:35 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2022-04-11 22:11:07 -0400
commita45e2284dad17fbbba3bea9d5e5304aab21c8c94 (patch)
treeac31614f2d53059570e2edffe731baf384baea23 /lib/sqlalchemy/orm/mapper.py
parentaa9cd878e8249a4a758c7f968e929e92fede42a5 (diff)
downloadsqlalchemy-a45e2284dad17fbbba3bea9d5e5304aab21c8c94.tar.gz
pep-484: asyncio
in this patch the asyncio/events.py module, which existed only to raise errors when trying to attach event listeners, is removed, as we were already coding an asyncio-specific workaround in upstream Pool / Session to raise this error, just moved the error out to the target and did the same thing for Engine. We also add an async_sessionmaker class. The initial rationale here is because sessionmaker() is hardcoded to Session subclasses, and there's not a way to get the use case of sessionmaker(class_=AsyncSession) to type correctly without changing the sessionmaker() symbol itself to be a function and not a class, which gets too complicated for what this is. Additionally, _SessionClassMethods has only three methods on it, one of which is not usable with asyncio (close_all()), the others not generally used from the session class. Change-Id: I064a5fa5d91cc8d5bbe9597437536e37b4e801fe
Diffstat (limited to 'lib/sqlalchemy/orm/mapper.py')
-rw-r--r--lib/sqlalchemy/orm/mapper.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py
index c85861a59..abe11cc68 100644
--- a/lib/sqlalchemy/orm/mapper.py
+++ b/lib/sqlalchemy/orm/mapper.py
@@ -132,6 +132,8 @@ class Mapper(
_identity_class: Type[_O]
always_refresh: bool
+ allow_partial_pks: bool
+ version_id_col: Optional[ColumnElement[Any]]
@util.deprecated_params(
non_primary=(
@@ -2931,7 +2933,7 @@ class Mapper(
self,
state: InstanceState[_O],
dict_: _InstanceDict,
- column: Column[Any],
+ column: ColumnElement[Any],
passive: PassiveFlag = PassiveFlag.PASSIVE_RETURN_NO_VALUE,
) -> Any:
prop = self._columntoproperty[column]