From: Federico Caselli Date: Wed, 18 Oct 2023 17:51:00 +0000 (+0200) Subject: Remove compare_against_backend X-Git-Tag: rel_2_0_23~18^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7244d37d3bb8edaedc7679e422e58e543428ce1e;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Remove compare_against_backend Removed unused placeholder method :meth:`.TypeEngine.compare_against_backend` This method was used by very old versions of Alembic. See https://github.com/sqlalchemy/alembic/issues/1293 for details. Follow up of alembic change I6f480711ec94cd4113d3f0ca114d143b49b8d869 Change-Id: I48ba2b26128ba6f74cb0b2c54caa6f7d2a711257 --- diff --git a/doc/build/changelog/unreleased_20/compare_against_backend.rst b/doc/build/changelog/unreleased_20/compare_against_backend.rst new file mode 100644 index 0000000000..59291e5b0e --- /dev/null +++ b/doc/build/changelog/unreleased_20/compare_against_backend.rst @@ -0,0 +1,6 @@ +.. change:: + :tags: sql + + Removed unused placeholder method :meth:`.TypeEngine.compare_against_backend` + This method was used by very old versions of Alembic. + See https://github.com/sqlalchemy/alembic/issues/1293 for details. diff --git a/lib/sqlalchemy/sql/type_api.py b/lib/sqlalchemy/sql/type_api.py index f839cf57d8..9cf4872d02 100644 --- a/lib/sqlalchemy/sql/type_api.py +++ b/lib/sqlalchemy/sql/type_api.py @@ -354,33 +354,6 @@ class TypeEngine(Visitable, Generic[_T]): def copy(self, **kw: Any) -> Self: return self.adapt(self.__class__) - def compare_against_backend( - self, dialect: Dialect, conn_type: TypeEngine[Any] - ) -> Optional[bool]: - """Compare this type against the given backend type. - - This function is currently not implemented for SQLAlchemy - types, and for all built in types will return ``None``. However, - it can be implemented by a user-defined type - where it can be consumed by schema comparison tools such as - Alembic autogenerate. - - A future release of SQLAlchemy will potentially implement this method - for builtin types as well. - - The function should return True if this type is equivalent to the - given type; the type is typically reflected from the database - so should be database specific. The dialect in use is also - passed. It can also return False to assert that the type is - not equivalent. - - :param dialect: a :class:`.Dialect` that is involved in the comparison. - - :param conn_type: the type object reflected from the backend. - - """ - return None - def copy_value(self, value: Any) -> Any: return value