Skip to content

Commit a4316ca

Browse files
committed
Experiment.
1 parent 35e9079 commit a4316ca

File tree

2 files changed

+77
-69
lines changed

2 files changed

+77
-69
lines changed

.github/workflows/tests.yml

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -31,44 +31,45 @@ jobs:
3131
matrix:
3232
os: [ubuntu-latest]
3333
python-version: ["3.9"]
34-
pytest_args: [tests]
35-
runtime-version: [upstream, latest, "0.2.1"]
34+
pytest_args: [tests/benchmarks/test_arrow.py]
35+
runtime-version: [upstream]
36+
# runtime-version: [upstream, latest, "0.2.1"]
3637
include:
3738
# Run stability tests on Python 3.8
3839
- pytest_args: tests/stability
3940
python-version: "3.8"
4041
runtime-version: upstream
4142
os: ubuntu-latest
42-
- pytest_args: tests/stability
43-
python-version: "3.8"
44-
runtime-version: latest
45-
os: ubuntu-latest
46-
- pytest_args: tests/stability
47-
python-version: "3.8"
48-
runtime-version: "0.2.1"
49-
os: ubuntu-latest
43+
# - pytest_args: tests/stability
44+
# python-version: "3.8"
45+
# runtime-version: latest
46+
# os: ubuntu-latest
47+
# - pytest_args: tests/stability
48+
# python-version: "3.8"
49+
# runtime-version: "0.2.1"
50+
# os: ubuntu-latest
5051
# Run stability tests on Python 3.10
5152
- pytest_args: tests/stability
5253
python-version: "3.10"
5354
runtime-version: upstream
5455
os: ubuntu-latest
55-
- pytest_args: tests/stability
56-
python-version: "3.10"
57-
runtime-version: latest
58-
os: ubuntu-latest
59-
- pytest_args: tests/stability
60-
python-version: "3.10"
61-
runtime-version: "0.2.1"
62-
os: ubuntu-latest
56+
# - pytest_args: tests/stability
57+
# python-version: "3.10"
58+
# runtime-version: latest
59+
# os: ubuntu-latest
60+
# - pytest_args: tests/stability
61+
# python-version: "3.10"
62+
# runtime-version: "0.2.1"
63+
# os: ubuntu-latest
6364
# Run stability tests on Python Windows and MacOS (latest py39 only)
64-
- pytest_args: tests/stability
65-
python-version: "3.9"
66-
runtime-version: latest
67-
os: windows-latest
68-
- pytest_args: tests/stability
69-
python-version: "3.9"
70-
runtime-version: latest
71-
os: macos-latest
65+
# - pytest_args: tests/stability
66+
# python-version: "3.9"
67+
# runtime-version: latest
68+
# os: windows-latest
69+
# - pytest_args: tests/stability
70+
# python-version: "3.9"
71+
# runtime-version: latest
72+
# os: macos-latest
7273

7374
steps:
7475
- name: Checkout

tests/benchmarks/test_arrow.py

Lines changed: 50 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,59 @@
1-
import pytest
21
import pandas as pd
2+
import pytest
33

44
from ..utils_test import cluster_memory, timeseries_of_size, wait
55

66

7-
@pytest.mark.skipif()
8-
def test_unique(small_client):
9-
"""Find unique values"""
10-
memory = cluster_memory(small_client)
11-
df = timeseries_of_size(memory)
12-
s = df.name.astype(pd.StringDtype("pyarrow")).persist()
13-
result = s.unique()
14-
wait(result, small_client, 10 * 60)
15-
16-
17-
def test_contains(small_client):
18-
"""String contains"""
19-
memory = cluster_memory(small_client)
20-
df = timeseries_of_size(memory)
21-
s = df.name.astype(pd.StringDtype("pyarrow")).persist()
22-
result = s.str.contains("a")
23-
wait(result, small_client, 10 * 60)
24-
25-
26-
def test_startswith(small_client):
27-
"""String starts with"""
7+
@pytest.fixture(params=[True, False])
8+
def series_with_client(request, small_client):
289
memory = cluster_memory(small_client)
2910
df = timeseries_of_size(memory)
30-
s = df.name.astype(pd.StringDtype("pyarrow")).persist()
31-
result = s.str.startswith("B")
32-
wait(result, small_client, 10 * 60)
33-
11+
if request.param:
12+
series = df.name.astype(pd.StringDtype("pyarrow"))
13+
series = series.persist()
14+
yield series, small_client
3415

35-
def test_filter(small_client):
36-
"""How fast can we filter a DataFrame?"""
37-
memory = cluster_memory(small_client)
38-
df = timeseries_of_size(memory)
39-
df.name = df.name.astype(pd.StringDtype("pyarrow"))
40-
df = df.persist()
41-
name = df.head(1).name.iloc[0] # Get first name that appears
42-
result = df[df.name == name]
43-
wait(result, small_client, 10 * 60)
4416

45-
46-
def test_value_counts(small_client):
47-
"""Value counts on string values"""
48-
memory = cluster_memory(small_client)
49-
df = timeseries_of_size(memory)
50-
s = df.name.astype(pd.StringDtype("pyarrow")).persist()
51-
result = s.value_counts()
52-
wait(result, small_client, 10 * 60)
17+
def test_unique(series_with_client):
18+
"""Find unique values"""
19+
series, client = series_with_client
20+
result = series.unique()
21+
wait(result, client, 10 * 60)
22+
23+
24+
# def test_contains(small_client):
25+
# """String contains"""
26+
# memory = cluster_memory(small_client)
27+
# df = timeseries_of_size(memory)
28+
# s = df.name.astype(pd.StringDtype("pyarrow")).persist()
29+
# result = s.str.contains("a")
30+
# wait(result, small_client, 10 * 60)
31+
#
32+
#
33+
# def test_startswith(small_client):
34+
# """String starts with"""
35+
# memory = cluster_memory(small_client)
36+
# df = timeseries_of_size(memory)
37+
# s = df.name.astype(pd.StringDtype("pyarrow")).persist()
38+
# result = s.str.startswith("B")
39+
# wait(result, small_client, 10 * 60)
40+
#
41+
#
42+
# def test_filter(small_client):
43+
# """How fast can we filter a DataFrame?"""
44+
# memory = cluster_memory(small_client)
45+
# df = timeseries_of_size(memory)
46+
# df.name = df.name.astype(pd.StringDtype("pyarrow"))
47+
# df = df.persist()
48+
# name = df.head(1).name.iloc[0] # Get first name that appears
49+
# result = df[df.name == name]
50+
# wait(result, small_client, 10 * 60)
51+
#
52+
#
53+
# def test_value_counts(small_client):
54+
# """Value counts on string values"""
55+
# memory = cluster_memory(small_client)
56+
# df = timeseries_of_size(memory)
57+
# s = df.name.astype(pd.StringDtype("pyarrow")).persist()
58+
# result = s.value_counts()
59+
# wait(result, small_client, 10 * 60)

0 commit comments

Comments
 (0)