]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
typing: pg: type NamedType create/drops (fixes #12557)
authorJustine Krejcha <justine@justinekrejcha.com>
Tue, 6 May 2025 19:18:02 +0000 (15:18 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 8 May 2025 01:40:18 +0000 (21:40 -0400)
commitb4d7bf7a2f74db73e12f47ca4cb45666bf08439e
treefffb0a672dbd7953bd0853444375489944bddc68
parent912ddc0ac32d3dc99f1b0fc8d905c810fa451318
typing: pg: type NamedType create/drops (fixes #12557)

Type the `create` and `drop` functions for `NamedType`s

Also partially type the SchemaType create/drop functions more generally

One change to this is that the default parameter of `None` is removed. It doesn't work and will fail with a `AttributeError` at runtime since it immediately tries to access a property of `None` which doesn't exist.

Fixes #12557

This pull request is:

- [X] A documentation / typographical / small typing error fix
- Good to go, no issue or tests are needed
- [X] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #12558
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12558
Pull-request-sha: 75c8d81bfb68f45299a9448d45dda446532205d3

Change-Id: I173771d365f34f54ab474b9661e1cdc70cc4de84
lib/sqlalchemy/dialects/postgresql/named_types.py
lib/sqlalchemy/engine/base.py
lib/sqlalchemy/engine/mock.py
lib/sqlalchemy/schema.py
lib/sqlalchemy/sql/_typing.py
lib/sqlalchemy/sql/base.py
lib/sqlalchemy/sql/ddl.py
lib/sqlalchemy/sql/schema.py
lib/sqlalchemy/sql/sqltypes.py
test/sql/test_types.py