summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2022-05-17 14:33:05 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2022-05-17 14:42:41 -0400
commit9e7bed9df601ead02fd96bf2fc787b23b536d2d6 (patch)
treeae4646f888cd2535d4547a7bfe7c051e8915f6fc /lib/sqlalchemy
parent5e88e6e89a2cf5b583670fa5d0b41881f895a711 (diff)
downloadsqlalchemy-9e7bed9df601ead02fd96bf2fc787b23b536d2d6.tar.gz
remove unused "descriptor" param from ColumnProperty
this appears to be unused and wasn't documented, even though in the method sig for column_property(). just whack it also repairs a typing issue in decl_base that seemed to somehow not fail previously. Change-Id: Id5c8e716b7e53715778921ab03707642cadbfdee
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/orm/_orm_constructors.py4
-rw-r--r--lib/sqlalchemy/orm/decl_base.py9
-rw-r--r--lib/sqlalchemy/orm/properties.py3
3 files changed, 9 insertions, 7 deletions
diff --git a/lib/sqlalchemy/orm/_orm_constructors.py b/lib/sqlalchemy/orm/_orm_constructors.py
index 18a18bd80..0692cac09 100644
--- a/lib/sqlalchemy/orm/_orm_constructors.py
+++ b/lib/sqlalchemy/orm/_orm_constructors.py
@@ -325,7 +325,6 @@ def column_property(
deferred: bool = False,
raiseload: bool = False,
comparator_factory: Optional[Type[PropComparator[_T]]] = None,
- descriptor: Optional[Any] = None,
active_history: bool = False,
expire_on_flush: bool = True,
info: Optional[_InfoType] = None,
@@ -387,7 +386,7 @@ def column_property(
flush, that is, has any kind of "dirty" state within a flush.
Setting this parameter to ``False`` will have the effect of
leaving any existing value present after the flush proceeds.
- Note however that the :class:`.Session` with default expiration
+ Note that the :class:`.Session` with default expiration
settings still expires
all attributes after a :meth:`.Session.commit` call, however.
@@ -421,7 +420,6 @@ def column_property(
deferred=deferred,
raiseload=raiseload,
comparator_factory=comparator_factory,
- descriptor=descriptor,
active_history=active_history,
expire_on_flush=expire_on_flush,
info=info,
diff --git a/lib/sqlalchemy/orm/decl_base.py b/lib/sqlalchemy/orm/decl_base.py
index 6bd957de1..a66421e22 100644
--- a/lib/sqlalchemy/orm/decl_base.py
+++ b/lib/sqlalchemy/orm/decl_base.py
@@ -19,6 +19,7 @@ from typing import List
from typing import Mapping
from typing import NoReturn
from typing import Optional
+from typing import Sequence
from typing import Tuple
from typing import Type
from typing import TYPE_CHECKING
@@ -63,6 +64,7 @@ if TYPE_CHECKING:
from ._typing import _RegistryType
from .decl_api import declared_attr
from .instrumentation import ClassManager
+ from ..sql.elements import NamedColumn
from ..sql.schema import MetaData
from ..sql.selectable import FromClause
@@ -228,7 +230,12 @@ class _MapperConfig:
cls: Type[Any]
classname: str
- properties: util.OrderedDict[str, MapperProperty[Any]]
+ properties: util.OrderedDict[
+ str,
+ Union[
+ Sequence[NamedColumn[Any]], NamedColumn[Any], MapperProperty[Any]
+ ],
+ ]
declared_attr_reg: Dict[declared_attr[Any], Any]
@classmethod
diff --git a/lib/sqlalchemy/orm/properties.py b/lib/sqlalchemy/orm/properties.py
index 911617d6d..ad3e9f248 100644
--- a/lib/sqlalchemy/orm/properties.py
+++ b/lib/sqlalchemy/orm/properties.py
@@ -116,7 +116,6 @@ class ColumnProperty(
"deferred",
"instrument",
"comparator_factory",
- "descriptor",
"active_history",
"expire_on_flush",
"_creation_order",
@@ -136,7 +135,6 @@ class ColumnProperty(
deferred: bool = False,
raiseload: bool = False,
comparator_factory: Optional[Type[PropComparator[_T]]] = None,
- descriptor: Optional[Any] = None,
active_history: bool = False,
expire_on_flush: bool = True,
info: Optional[_InfoType] = None,
@@ -163,7 +161,6 @@ class ColumnProperty(
if comparator_factory is not None
else self.__class__.Comparator
)
- self.descriptor = descriptor
self.active_history = active_history
self.expire_on_flush = expire_on_flush