TST: Add failing test for HAVING feature request#1458
TST: Add failing test for HAVING feature request#1458sandhujasmine wants to merge 4 commits intoblaze:masterfrom
Conversation
Add failing test and mark as xfail for requested feature in GH 1457.
| ds = discover(big_sql) | ||
| nn = symbol('nn', ds) | ||
| g1 = by(nn['A'], quant=nn.B.sum()) | ||
| g1_res = odo(compute(g1, big_sql), list) |
There was a problem hiding this comment.
Can you remove the odo call and convert this to compute(g1, big_sql, return_type=list) instead, for consistency?
| pytest.skip(str(e)) | ||
| else: | ||
| t = odo(zip(list('a'*100), list(range(100))), t) | ||
| t = odo(zip(list("".join(['a'*25, 'b'*25, 'c'*25, 'd'*25])), |
There was a problem hiding this comment.
style nit: can we put spaces around binary operators, without them expressions are very crowded
GH 1458: add more tests for testing an expression involving WHERE, HAVING and also multiple conditions on predicate. Move data to pandas dataframe and assert blaze results against it. Fix usage of compute() so it is consistent with API update and other tests. Add spaces around operator for readability.
| g1_res = compute(g1, big_sql, return_type=pd.DataFrame) | ||
| assert len(g1_res) == 4 | ||
|
|
||
| expr = g1[(g1.quant < 100) & (g1.quant > 50)] |
There was a problem hiding this comment.
Looks like this part of the expression expr is not being correctly computed for Python 2.7 .. will setup a 2.7 environment and try to repro this error.
Looking at the error log - the resulting bz_res did not filter out the value greater than 100
There was a problem hiding this comment.
It's not a Python version issue. The SQL compiled is incorrect - still working on #1457
Failing tests for GH 1457 Test for HAVING and WHERE clause failing at present. Data is not randomly generated so we get failure when compiled expression contains both clauses.
|
HAVING tests were previously using randomly generated data - updated data so it is fixed and updated tests accordingly. |
|
Here's how to reproduce the incorrect SQL for the two conditionals on group_by expression. |
Add failing test and mark as xfail for requested feature in GH 1457.
#1457
Test can be run using odo docker provisioning