From eea15e512657a0b37690af0223f6fff8e9b8f839 Mon Sep 17 00:00:00 2001 From: John Davis Date: Thu, 4 Apr 2024 23:38:56 -0400 Subject: [PATCH] Fix method resolution order for base model class --- lib/galaxy/model/__init__.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 4099f769f029..45ebc7db9830 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -230,13 +230,6 @@ from galaxy.tools import DefaultToolState from galaxy.workflow.modules import WorkflowModule - class _HasTable: - table: FromClause - __table__: FromClause - -else: - _HasTable = object - def get_uuid(uuid: Optional[Union[UUID, str]] = None) -> UUID: if isinstance(uuid, UUID): @@ -246,6 +239,11 @@ def get_uuid(uuid: Optional[Union[UUID, str]] = None) -> UUID: return UUID(str(uuid)) +class _HasTable: + table: FromClause + __table__: FromClause + + class Base(_HasTable, DeclarativeBase): __abstract__ = True metadata = MetaData(naming_convention=NAMING_CONVENTION)