[storm] Invalid enum value on find

Oscar Campos oscar.campos at open-phoenix.com
Wed Apr 3 15:41:48 UTC 2013


> Hi,

> Didn't try, but I think you should define your enum using the python
> unicode style...
>
> card_type = Enum(map={
>             u'VISA': 1, u'MC': 2, u'LASER': 3, u'AMEX': 4,
>             u'DINERS': 5, u'DELTA': 6, u'MAESTRO': 7
>         })
>
> Hope this helps

Thank you for your response but this is not the problem. I've been investigating and seems like EnumVariable uses a dictionary with those key:values -> {1: 'Y', 2: 'N'} as _get_map in the "parse_get" method that is used to retrieve the values of Enums from the database but MySQL (as well as MariaDB) return those values as 'Y' or 'N' and not with the numeric value so obviously Storm can not find the value for the key 'Y' (doesn't matter if it's unicode or not).

I was looking at Enum class constructor on properties.py and get_map can't be set as set_map make it available can be a way to don't hit this exception when using MySQL as backend and using Enums, I already monkeypatch Storm in my application to do the trick.

Anyone knows if this is a bug in Storm? shall I open a ticket for this?

Best Regards.




More information about the storm mailing list