Describe the bug
When running edgedb-py to create a query that includes and enum where the enum values contain spaces and/or dashes, the enum keys in the generated py source contain spaces and dashes too, leading to faulty syntax.
Reproduction
Create a query including an enum which contains spaces/dashes in their stirng values:
scalar type PROP_ENUM extending enum<"random", "some-value", "another space">;
select (insert object {
id := <str>$id,
some_prop := <PROP_ENUM>$some_prop,
}
) { id, some_prop};
Generated code:
class PropEnum(enum.Enum):
RANDOM= "random"
SOME-VALUE= "some-value"
ANOTHER SPACE= "another space"
Expected behavior
It should replace the spaces and dashes in the enum keys by underscores.
Versions (please complete the following information):
- OS: Ubuntu 0.04.5 LTS (Focal Fossa)
- EdgeDB version: 2.15+75c3494
- EdgeDB CLI version: 3.0.0+8b024db
edgedb-python version: 1.3.0
- Python version: 3.10.10
Describe the bug
When running edgedb-py to create a query that includes and enum where the enum values contain spaces and/or dashes, the enum keys in the generated py source contain spaces and dashes too, leading to faulty syntax.
Reproduction
Create a query including an enum which contains spaces/dashes in their stirng values:
Generated code:
Expected behavior
It should replace the spaces and dashes in the enum keys by underscores.
Versions (please complete the following information):
edgedb-pythonversion: 1.3.0