Skip to content

TypeError: type 'ColumnElement' is not subscriptable" on alembic mssql.py #1788

@frederickney

Description

@frederickney

Describe the bug

Expected behavior

Unable to run alembic migrations

To Reproduce
Please try to provide a Minimal, Complete, and Verifiable example, with the migration script and/or the SQLAlchemy tables or models involved.
See also Reporting Bugs on the website.

Insert code here


File "/usr/local/lib/python3.12/site-packages/alembic/__init__.py", line 1, in <module>
    from . import context
  File "/usr/local/lib/python3.12/site-packages/alembic/context.py", line 1, in <module>
    from .runtime.environment import EnvironmentContext
  File "/usr/local/lib/python3.12/site-packages/alembic/runtime/environment.py", line 23, in <module>
    from .migration import _ProxyTransaction
  File "/usr/local/lib/python3.12/site-packages/alembic/runtime/migration.py", line 31, in <module>
    from .. import ddl
  File "/usr/local/lib/python3.12/site-packages/alembic/ddl/__init__.py", line 1, in <module>
    from . import mssql
  File "/usr/local/lib/python3.12/site-packages/alembic/ddl/mssql.py", line 20, in <module>
    from .base import AddColumn
  File "/usr/local/lib/python3.12/site-packages/alembic/ddl/base.py", line 39, in <module>
    _ServerDefaultType = Union[FetchedValue, str, TextClause, ColumnElement[Any]]
                                                              ~~~~~~~~~~~~~^^^^^
TypeError: type 'ColumnElement' is not subscriptable"

Copy error here. Please include the full stack trace.

Versions.

  • OS: any
  • Python: 3.12
  • Alembic: 1.8.2
  • SQLAlchemy: 1.4.22
  • Database: any
  • DBAPI:

Additional context

Have a nice day!

Metadata

Metadata

Assignees

No one assigned

    Labels

    external SQLAlchemy issuesthe issue is in SQLAlchemy, not here in alembicpep 484typing related issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions