diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-03-25 17:08:48 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-03-30 14:04:52 -0400 |
| commit | 4e754a8914a1c2c16c97bdf363d2e24bfa823730 (patch) | |
| tree | db723242b4e4c0d4c7f15c167857dd79fdfa6ccb /lib/sqlalchemy/orm/interfaces.py | |
| parent | dba480ebaf89c0b5ea787661583de9da3928920f (diff) | |
| download | sqlalchemy-4e754a8914a1c2c16c97bdf363d2e24bfa823730.tar.gz | |
pep-484: the pep-484ening, SQL part three
hitting DML which is causing us to open up the
ColumnCollection structure a bit, as we do put anonymous
column expressions with None here. However, we still want
Table /TableClause to have named column collections that
don't return None, so parametrize the "key" in this
collection also.
* rename some "immutable" elements to "readonly". we change
the contents of immutablecolumncollection underneath, so it's
not "immutable"
Change-Id: I2593995a4e5c6eae874bed5bf76117198be8ae97
Diffstat (limited to 'lib/sqlalchemy/orm/interfaces.py')
| -rw-r--r-- | lib/sqlalchemy/orm/interfaces.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/sqlalchemy/orm/interfaces.py b/lib/sqlalchemy/orm/interfaces.py index d79774187..b4228323b 100644 --- a/lib/sqlalchemy/orm/interfaces.py +++ b/lib/sqlalchemy/orm/interfaces.py @@ -24,6 +24,7 @@ from typing import Any from typing import cast from typing import List from typing import Optional +from typing import Sequence from typing import Tuple from typing import Type from typing import TypeVar @@ -50,7 +51,6 @@ from .. import util from ..sql import operators from ..sql import roles from ..sql import visitors -from ..sql._typing import _ColumnsClauseElement from ..sql.base import ExecutableOption from ..sql.cache_key import HasCacheKey from ..sql.elements import SQLCoreOperations @@ -60,6 +60,8 @@ from ..util.typing import TypedDict if typing.TYPE_CHECKING: from .decl_api import RegistryType + from ..sql._typing import _ColumnsClauseArgument + from ..sql._typing import _DMLColumnArgument _T = TypeVar("_T", bound=Any) @@ -90,8 +92,8 @@ class ORMColumnDescription(TypedDict): name: str type: Union[Type, TypeEngine] aliased: bool - expr: _ColumnsClauseElement - entity: Optional[_ColumnsClauseElement] + expr: _ColumnsClauseArgument + entity: Optional[_ColumnsClauseArgument] class _IntrospectsAnnotations: @@ -468,7 +470,7 @@ class PropComparator(SQLORMOperations[_T]): def _bulk_update_tuples( self, value: Any - ) -> List[Tuple[SQLCoreOperations[_T], Any]]: + ) -> Sequence[Tuple[_DMLColumnArgument, Any]]: """Receive a SQL expression that represents a value in the SET clause of an UPDATE statement. |
