summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2023-03-30 19:17:00 +0000
committerGerrit Code Review <gerrit@bbpush.zzzcomputing.com>2023-03-30 19:17:00 +0000
commit77357be824095b46eb2ed3206bc555a6dacc7f30 (patch)
tree472f409018ef6c841034e334b495fcc369ed6db9 /lib/sqlalchemy
parent8416ab31934b6265ff7b79cedc999a182d41c3ec (diff)
parentb452f989da49761c5174b299024fea3e13a05221 (diff)
downloadsqlalchemy-77357be824095b46eb2ed3206bc555a6dacc7f30.tar.gz
Merge "assign correct typing to deferred(), query_property()" into main
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/orm/_orm_constructors.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/sqlalchemy/orm/_orm_constructors.py b/lib/sqlalchemy/orm/_orm_constructors.py
index 9f9330cea..11ed80d8c 100644
--- a/lib/sqlalchemy/orm/_orm_constructors.py
+++ b/lib/sqlalchemy/orm/_orm_constructors.py
@@ -24,7 +24,6 @@ from ._typing import _O
from .descriptor_props import Composite
from .descriptor_props import Synonym
from .interfaces import _AttributeOptions
-from .properties import ColumnProperty
from .properties import MappedColumn
from .properties import MappedSQLExpression
from .query import AliasOption
@@ -1971,7 +1970,7 @@ def deferred(
expire_on_flush: bool = True,
info: Optional[_InfoType] = None,
doc: Optional[str] = None,
-) -> ColumnProperty[_T]:
+) -> MappedSQLExpression[_T]:
r"""Indicate a column-based mapped attribute that by default will
not load unless accessed.
@@ -1997,7 +1996,7 @@ def deferred(
:ref:`orm_queryguide_deferred_imperative`
"""
- return ColumnProperty(
+ return MappedSQLExpression(
column,
*additional_columns,
attribute_options=_AttributeOptions(
@@ -2021,7 +2020,7 @@ def query_expression(
expire_on_flush: bool = True,
info: Optional[_InfoType] = None,
doc: Optional[str] = None,
-) -> ColumnProperty[_T]:
+) -> MappedSQLExpression[_T]:
"""Indicate an attribute that populates from a query-time SQL expression.
:param default_expr: Optional SQL expression object that will be used in
@@ -2034,7 +2033,7 @@ def query_expression(
:ref:`orm_queryguide_with_expression` - background and usage examples
"""
- prop = ColumnProperty(
+ prop = MappedSQLExpression(
default_expr,
attribute_options=_AttributeOptions(
_NoArg.NO_ARG,