logv / snorkel

UI for interactive data analysis | https://snorkel.logv.org
https://fb.com/groups/snorkelsnorkelsnorkel
161 stars 21 forks source link

py3 version fails on import #52

Closed niteria closed 4 years ago

niteria commented 4 years ago

Here's how I build/run it: make virtualenv3 && make binary3 && sudo pip3 install dist/current/snorkel_lite-current-py3-none-any.whl && /usr/local/bin/snorkel.frontend

Here's a simple request I send:

curl -H "Content-Type: application/json" -d'{"dataset":"test","subset":"test","samples":{"integer":{},"string":{"a":"a"},"set":{}}}' 'http://0.0.0.0:2333/data/import?auth_token=<MY_TOKEN>"

It responds with 500 and I get this in the logs:

[2020-04-27 15:49:53,349] ERROR in app: Exception on /data/import [POST]
Traceback (most recent call last):                                                                                                                                                                                
  File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()                                                                                                                                                                       
  File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)                                                                                                                                                                            
  File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1821, in handle_user_exception   
    reraise(exc_type, exc_value, tb)                                                                     
  File "/usr/local/lib/python3.7/dist-packages/flask/_compat.py", line 39, in reraise                                                                                                                             
    raise value
  File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/niteria/.local/lib/python3.7/site-packages/snorkel/auth.py", line 102, in wrapped_func
    return func(*args, **kwargs)
  File "/home/niteria/.local/lib/python3.7/site-packages/snorkel/web.py", line 162, in post_data
    if isinstance(samples, (str, unicode)):
NameError: name 'unicode' is not defined
okayzed commented 4 years ago

I'm pushing a fix for this now that removes the line involving unicode

okayzed commented 4 years ago

should be fixed, i see that py3 works in #51