8000 TST: Add coverage for a selection with an inverted elemwise. by ehebert · Pull Request #1648 · blaze/blaze · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

TST: Add coverage for a selection with an inverted elemwise. #1648

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions blaze/compute/tests/test_postgresql_compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,21 +849,29 @@ def test_all(sql):
def test_isin_selectable(sql):
s = symbol('s', discover(sql))

# wrap the resource in a select
assert compute(s.B.isin({1, 3}),
sa.select(sql._resources()[sql].columns),
return_type=list) == [True, False]
assert (
compute(s.B.isin({1, 3}), {s: sql}, return_type=list) ==
[True, False]
)


def test_selection_selectable(sql):
s = symbol('s', discover(sql))

tm.assert_frame_equal(
compute(s[s.B.isin({1, 3})], {s: sql}, return_type=pd.DataFrame),
pd.DataFrame([['a', 1]], columns=s.dshape.measure.names)
)


def test_selection_inverted_selectable(sql):
s = symbol('s', discover(sql))

# wrap the resource in a select
assert (compute(s[s.B.isin({1, 3})],
sa.select(sql._resources()[sql].columns),
return_type=pd.DataFrame) ==
pd.DataFrame([['a', 1]],
columns=s.dshape.measure.names)).all().all()
tm.assert_frame_equal(
compute(s[~s.B.isin({1, 3})], {s: sql}, return_type=pd.DataFrame),
pd.DataFrame([['b', 2]], columns=s.dshape.measure.names)
)


@pytest.mark.parametrize(
Expand Down
0