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

Don't know how to compute `like()` on SQL select #1371

Closed
kwmsmith opened this Issue Dec 28, 2015 · 1 comment

Comments

Projects
None yet
1 participant
@kwmsmith
Member

kwmsmith commented Dec 28, 2015

Minimal example:

from odo import odo
import blaze as bz
import pandas as pd

db0 = odo(pd.DataFrame({'a': ['a', 'b', 'c']}), 'sqlite:///db.db::df0')
db1 = odo(pd.DataFrame({'b': ['b', 'c', 'd']}), 'sqlite:///db.db::df1')
dd0 = bz.Data(db0)
dd1 = bz.Data(db1)
j = bz.join(dd0, dd1, on_left='a', on_right='b')
bz.compute(j[j.a.like('*b')])

Running the above, I get:

In [1]: %run bug_compute_like_selectable.py
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
/Users/ksmith/work/blaze/blaze-repo/bugfix_compute_like_selectable.py in <module>()
     10 dd1 = bz.Data(db1)
     11 j = bz.join(dd0, dd1, on_left='a', on_right='b')
---> 12 bz.compute(j[j.a.like('*b')])

/Users/ksmith/anaconda/envs/tblaze/lib/python2.7/site-packages/multipledispatch/dispatcher.pyc in __call__(self, *args, **kwargs)
    162             self._cache[types] = func
    163         try:
--> 164             return func(*args, **kwargs)
    165
    166         except MDNotImplementedError:

/Users/ksmith/work/blaze/blaze-repo/blaze/interactive.pyc in compute(expr, **kwargs)
    169         raise ValueError("No data resources found")
    170     else:
--> 171         return compute(expr, resources, **kwargs)
    172
    173

/Users/ksmith/anaconda/envs/tblaze/lib/python2.7/site-packages/multipledispatch/dispatcher.pyc in __call__(self, *args, **kwargs)
    162             self._cache[types] = func
    163         try:
--> 164             return func(*args, **kwargs)
    165
    166         except MDNotImplementedError:

/Users/ksmith/work/blaze/blaze-repo/blaze/compute/core.pyc in compute(expr, d, **kwargs)
    402         d4 = d3
    403
--> 404     result = top_then_bottom_then_top_again_etc(expr3, d4, **kwargs)
    405     if post_compute_:
    406         result = post_compute_(expr3, result, scope=d4)

/Users/ksmith/work/blaze/blaze-repo/blaze/compute/core.pyc in top_then_bottom_then_top_again_etc(expr, scope, **kwargs)
    195                                   "data: %s" % (expr3, scope4))
    196     else:
--> 197         return top_then_bottom_then_top_again_etc(expr3, scope4, **kwargs)
    198
    199

/Users/ksmith/work/blaze/blaze-repo/blaze/compute/core.pyc in top_then_bottom_then_top_again_etc(expr, scope, **kwargs)
    195                                   "data: %s" % (expr3, scope4))
    196     else:
--> 197         return top_then_bottom_then_top_again_etc(expr3, scope4, **kwargs)
    198
    199

/Users/ksmith/work/blaze/blaze-repo/blaze/compute/core.pyc in top_then_bottom_then_top_again_etc(expr, scope, **kwargs)
    193         raise NotImplementedError("Don't know how to compute:\n"
    194                                   "expr: %s\n"
--> 195                                   "data: %s" % (expr3, scope4))
    196     else:
    197         return top_then_bottom_then_top_again_etc(expr3, scope4, **kwargs)

NotImplementedError: Don't know how to compute:
expr: _[Like(_child=a, pattern='*b')]
data: {a: <sqlalchemy.sql.selectable.Select at 0x10b1eefd0; Select object>, _: <sqlalchemy.sql.selectable.Select at 0x10b1ee690; Select object>}

ping @sandhujasmine

@kwmsmith

This comment has been minimized.

Member

kwmsmith commented Jan 25, 2016

Closed by #1373.

@kwmsmith kwmsmith closed this Jan 25, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment