-
Notifications
You must be signed in to change notification settings - Fork 390
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
Fix for issue #1240. #1247
Fix for issue #1240. #1247
Changes from 4 commits
eea853f
18e1f96
053b71b
913c920
6043282
3522adb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
from blaze.interactive import Data, compute, concrete_head, expr_repr, to_html | ||
|
||
import datetime | ||
from re import sub | ||
from odo import into, append | ||
from odo.backends.csv import CSV | ||
from blaze import discover | ||
from blaze import discover, transform | ||
from blaze.compute.core import compute | ||
from blaze.compute.python import compute | ||
from blaze.expr import symbol | ||
|
@@ -94,6 +95,13 @@ def test_repr(): | |
assert '...' in result | ||
|
||
|
||
def test_str_does_not_repr(): | ||
# see GH issue #1240. | ||
d = Data([('aa', 1), ('b', 2)], dshape='2 * {a: string, b: int64}') | ||
expr = transform(d, c=d.a.strlen() + d.b) | ||
assert sub(r'_\d+', 'XXX', str(expr)) == "Merge(_child=XXX, children=(XXX, label(strlen(_child=XXX.a) + XXX.b, 'c')))" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. small nitpick can you keep the i also think that even though the name of the expression is an implementation detail it should be consistently numbered and therefore it'd be okay to not do the replace and just keep There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought of doing that, but my concern is that the |
||
|
||
|
||
def test_repr_of_scalar(): | ||
assert repr(t.amount.sum()) == '300' | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sort of unrelated, but the else clause is just
return pformat(s).rstrip()