-
Notifications
You must be signed in to change notification settings - Fork 326
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
AttributeError: 'NoneType' object has no attribute 'number_symbols' #72
Comments
@ablaze95 did you find the solution ? |
Hello. |
Hi~I met the same problem, after read through the code I found it is due to the fact that the it is because in wikisql lib dbengine.py, when using "val = float(parse_decimal(val))" to convert the decimal string to decimal, they used babel package's parse_decimal method in default parameter of "locale"("locale" is what decide how to explain the number, for example if in "en", 197,168 means 197168, while in "de" German, it means 197.168), and the default locale is judeged by you utf-encode of the python file. So it may perform normal in mostly conditions, especially in US I think, but unnormally performed in some cases, which it set the locale to None, which cause the problem above "AttributeError: 'NoneType' object has no attribute 'number_symbols'", TL;DR, please change "val = float(parse_decimal(val))" to "val = float(parse_decimal(val, locale='en_US'))" , And I hope this be fixed or be pulled request to this wikisql code to make it perform well on all the devices. |
Hi, I have the same issue. Any solution to this problem yet? |
|
When i run evaluate.py on example 'pred.dev.jsonl' i get this error, what sould i do?
C:\Users\Admin\anaconda3\python.exe C:/Users/Admin/Desktop/WikiSQL-master/evaluate.py
30%|██▉ | 2517/8421 [00:04<00:10, 562.58it/s]
Traceback (most recent call last):
File "C:/Users/Admin/Desktop/WikiSQL-master/evaluate.py", line 29, in
gold = engine.execute_query(eg['table_id'], qg, lower=True)
File "C:\Users\Admin\Desktop\WikiSQL-master\lib\dbengine.py", line 18, in execute_query
return self.execute(table_id, query.sel_index, query.agg_index, query.conditions, *args, **kwargs)
File "C:\Users\Admin\Desktop\WikiSQL-master\lib\dbengine.py", line 40, in execute
val = float(parse_decimal(val))
File "C:\Users\Admin\anaconda3\lib\site-packages\babel\numbers.py", line 707, in parse_decimal
group_symbol = get_group_symbol(locale)
File "C:\Users\Admin\anaconda3\lib\site-packages\babel\numbers.py", line 332, in get_group_symbol
return Locale.parse(locale).number_symbols.get('group', u',')
AttributeError: 'NoneType' object has no attribute 'number_symbols'
The text was updated successfully, but these errors were encountered: