Skip to content

Commit 9392386

Browse files
committed
Experiment.
1 parent 35e9079 commit 9392386

File tree

2 files changed

+78
-69
lines changed

2 files changed

+78
-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: 51 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,60 @@
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+
series = df.name
12+
if request.param:
13+
series = series.astype(pd.StringDtype("pyarrow"))
14+
series = series.persist()
15+
yield series, small_client
3416

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)
4417

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

0 commit comments

Comments
 (0)