-
Notifications
You must be signed in to change notification settings - Fork 261
feat(enum): add Enum type engine+python #1218
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,9 @@ pub enum BasicValueType { | |
| /// String encoded in UTF-8. | ||
| Str, | ||
|
|
||
| /// Enumerated symbolic value. | ||
| Enum, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should keep a bunch of allowed enum values here (as strings). The information is needed to create JSON schema, etc.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! Variants are field-specific, so I stored them.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. Thanks for the explanation. I think putting it into think we should go with |
||
|
|
||
| /// A boolean value. | ||
| Bool, | ||
|
|
||
|
|
@@ -71,6 +74,7 @@ impl std::fmt::Display for BasicValueType { | |
| match self { | ||
| BasicValueType::Bytes => write!(f, "Bytes"), | ||
| BasicValueType::Str => write!(f, "Str"), | ||
| BasicValueType::Enum => write!(f, "Enum"), | ||
| BasicValueType::Bool => write!(f, "Bool"), | ||
| BasicValueType::Int64 => write!(f, "Int64"), | ||
| BasicValueType::Float32 => write!(f, "Float32"), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably don't need this. Users can directly use Python's native way to represent enums, similar to union type.