From: Mike Bayer Date: Fri, 16 May 2025 14:33:03 +0000 (-0400) Subject: i think we dont need DOMAIN.adapt() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=37e1654bff3415856fc217f687bb0fbfac6666ba;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git i think we dont need DOMAIN.adapt() this seems to be redundant vs. what constructor copy does. Issues are afoot w/ domain in any case see multiple issues at [1] [1] https://github.com/sqlalchemy/sqlalchemy/discussions/12592 Change-Id: I49879df6b78170435f021889f8f56ec43abc75c7 Change-Id: Id8fba884d47f3a494764262e23b3cc889f2cd033 --- diff --git a/lib/sqlalchemy/dialects/postgresql/named_types.py b/lib/sqlalchemy/dialects/postgresql/named_types.py index c9d6e5844c..5807041ead 100644 --- a/lib/sqlalchemy/dialects/postgresql/named_types.py +++ b/lib/sqlalchemy/dialects/postgresql/named_types.py @@ -503,20 +503,6 @@ class DOMAIN(NamedType, sqltypes.SchemaType): def __test_init__(cls): return cls("name", sqltypes.Integer) - def adapt(self, impl, **kw): - if self.default: - kw["default"] = self.default - if self.constraint_name is not None: - kw["constraint_name"] = self.constraint_name - if self.not_null: - kw["not_null"] = self.not_null - if self.check is not None: - kw["check"] = str(self.check) - if self.create_type: - kw["create_type"] = self.create_type - - return super().adapt(impl, **kw) - class CreateEnumType(schema._CreateDropBase): __visit_name__ = "create_enum_type"