Skip to content

Conversation

@dswistowski
Copy link

@dswistowski dswistowski commented Nov 6, 2024

in case of type like:

CREATE TYPE operator AS ENUM (
    '=',
    '>',
    '<',
    '>=',
    '<='
);

current plugin will generate wrong python code:

class Operator(str, enum.Enum):
    = "="
    = ">"
    = "<"
    = ">="
    = "<="

after this change plugin will generate valid enum:

class Operator(str, enum.Enum):
    EQ = "="
    GT = ">"
    LT = "<"
    GTEQ = ">="
    LTEQ = "<="

in case of tye 'CREATE TYPE operator AS ENUM (\'=\', \'>\' ...)' current name generation will generate python enum with empty enum values names
@dswistowski dswistowski changed the title fix enum generation if it does contain only equality-sign fix: enum generation if it does contain only equality-sign Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant