Skip to content

Enum is giving TypeError #86

@nelsyeung

Description

@nelsyeung

Describe the bug
Enum type is giving TypeError: _FBString.__init__() got an unexpected keyword argument '_enums'.

To Reproduce

Run a firebird db, I used this compose.yaml:

services:
  db:
    image: firebirdsql/firebird
    restart: always
    environment:
      - FIREBIRD_ROOT_PASSWORD=foobar
      - FIREBIRD_USER=foo
      - FIREBIRD_PASSWORD=foobar
      - FIREBIRD_DATABASE=foo.fdb
      - FIREBIRD_DATABASE_DEFAULT_CHARSET=UTF8
    volumes:
      - db:/var/lib/firebird/data

Run this script (yes, I could use more modern orm stuff, but this gives me the least amount of code):

import sqlalchemy as sa
import sqlalchemy.ext.declarative
import typing_extensions as t

Base = sqlalchemy.ext.declarative.declarative_base()


class Session(Base):
    __tablename__ = "Session"

    id = sa.Column(sa.CHAR(32), primary_key=True)
    v = sa.Column(sa.Enum("foo"))


def main() -> None:
    Base.metadata.create_all(
        sa.create_engine(
            "firebird+firebird://foo:foobar@db//var/lib/firebird/data/foo.fdb"
        )
    )


if __name__ == "__main__":
    main()

Expected behavior
No errors

Desktop (please complete the following information):

  • OS: Fedora 43
  • Python 3.12
  • sqlalchemy: 2.0.48
  • sqlalchemy-firebird: 2.1
  • firebird-driver: 2.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions