This is an automated email from the ASF dual-hosted git repository. maximebeauchemin pushed a commit to branch fix_db_migrate in repository https://gitbox.apache.org/repos/asf/superset.git
commit fdbd644cf0e2a81eb4d2f688242391a722e4297a Author: Maxime Beauchemin <[email protected]> AuthorDate: Mon Apr 1 13:51:02 2024 -0700 fix: alembic's 'superset db migate' fails with CompileError When running on the latest `master` running a simple `superset db migrate` to generate a new database migration fails with error ``` sqlalchemy.exc.CompileError: PostgreSQL ENUM type requires a name. ``` This addresses the issue by giving a name to that particular enum. From my understanding, this particular enum wasn't created in a given migration script, so it may not be enforced at the database level, probably by choice/design. Having the name here simply allows for alembic's migrate subcommand to run. --- superset/connectors/sqla/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/superset/connectors/sqla/models.py b/superset/connectors/sqla/models.py index 5a644188bf..ce4632fc02 100644 --- a/superset/connectors/sqla/models.py +++ b/superset/connectors/sqla/models.py @@ -2055,7 +2055,10 @@ class RowLevelSecurityFilter(Model, AuditMixinNullable): name = Column(String(255), unique=True, nullable=False) description = Column(Text) filter_type = Column( - Enum(*[filter_type.value for filter_type in utils.RowLevelSecurityFilterType]) + Enum( + *[filter_type.value for filter_type in utils.RowLevelSecurityFilterType], + name="filter_type_enum", + ), ) group_key = Column(String(255), nullable=True) roles = relationship(
