Skip to content
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

Extract pre filter test #2194

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Binary file added tests/data/unittest.parquet
Binary file not shown.
21 changes: 21 additions & 0 deletions tests/execution_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,27 @@ async def means():




def test_mixed_pre_filtered() -> None:
df = vaex.from_arrays(x=np.arange(10))
df['y'] = df.x**2
with vaex.cache.off():
@vaex.delayed
def add(a, b):
return a + b

df2 = df[df.x > 2]
p1 = df2.sum(df.x, delay=True)
p2 = df2.nop(df.y, delay=True)
passes = df.executor.passes
tasks = df.executor.tasks.copy()
assert len(df.executor.tasks) == 2
df.execute()
assert df.executor.passes == passes + 1
# make sure we don't leave exceptions
p1.get()
p2.get()

# def test_add_and_cancel_tasks(df_executor):
# df = df_executor

Expand Down
2 changes: 2 additions & 0 deletions tests/extract_test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import threading
from concurrent.futures import ThreadPoolExecutor
from threading import Barrier
import time
Expand Down Expand Up @@ -33,3 +34,4 @@ def run(_ignore):
dff.extract()
pool = ThreadPoolExecutor(max_workers=100)
_values = list(pool.map(run, range(100)))