]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Make ARRAY generic on the item_type
authorDenis Laxalde <denis@laxalde.org>
Tue, 18 Mar 2025 16:23:01 +0000 (12:23 -0400)
committerFederico Caselli <cfederico87@gmail.com>
Tue, 18 Mar 2025 21:16:01 +0000 (22:16 +0100)
commit370fe6b6b7a4dbbdf44e8c48ba7ab85b0655cbf6
tree8197bcda7a7e0f595d78f7df90c50f77580a6fc1
parenta1d8e40e42a2472fae5d425c76e06e4c498dc4ec
Make ARRAY generic on the item_type

Now `Column(type_=ARRAY(Integer)` is inferred as `Column[Sequence[int]]` instead as `Column[Sequence[Any]]` previously. This only works with the `type_` argument to Column, but that's not new.

This follows from a suggestion at
https://github.com/sqlalchemy/sqlalchemy/pull/12386#issuecomment-2694056069.

Related to #6810.

Closes: #12443
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12443
Pull-request-sha: 2fff4e89cd0b72d9444ce3f3d845b152770fc55d

Change-Id: I87b828fd82d10fbf157141db3c31f0ec8149caad
(cherry picked from commit 500adfafcb782c5b22ff49e00192a2ed42ed09b6)
lib/sqlalchemy/dialects/postgresql/array.py
lib/sqlalchemy/sql/sqltypes.py
test/typing/plain_files/dialects/postgresql/pg_stuff.py