Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

int Enum can't be used with callback factory #885

Closed
JrooTJunior opened this issue Apr 11, 2022 · 0 comments · Fixed by #884
Closed

int Enum can't be used with callback factory #885

JrooTJunior opened this issue Apr 11, 2022 · 0 comments · Fixed by #884
Assignees
Labels
3.x Issue or PR for stable 3.x version bug Something is wrong with the framework
Projects
Milestone

Comments

@JrooTJunior
Copy link
Member

Context

Non-string enums can't be used with callback data factory

For example:

class MyEnum(Enum):
    foo = auto()
    bar = auto()


class MyCallback(CallbackData, prefix="my"):
    enum: MyEnum

Expected Behavior

MyCallback.unpack("my:1") -> MyCallback(enum=MyEnum.foo)

Current Behavior

Validation error

@JrooTJunior JrooTJunior added bug Something is wrong with the framework 3.x Issue or PR for stable 3.x version labels Apr 11, 2022
@JrooTJunior JrooTJunior added this to the 3.0 milestone Apr 11, 2022
@JrooTJunior JrooTJunior self-assigned this Apr 11, 2022
@JrooTJunior JrooTJunior added this to To do in 3.0 via automation Apr 11, 2022
@JrooTJunior JrooTJunior linked a pull request Apr 11, 2022 that will close this issue
10 tasks
3.0 automation moved this from To do to Done Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Issue or PR for stable 3.x version bug Something is wrong with the framework
Projects
3.0
  
Done
Development

Successfully merging a pull request may close this issue.

1 participant