|
| 1 | +from ..utils_test import cluster_memory, timeseries_of_size, wait |
| 2 | + |
| 3 | + |
| 4 | +def test_unique(small_client, convert_string): |
| 5 | + """Find unique values""" |
| 6 | + memory = cluster_memory(small_client) |
| 7 | + df = timeseries_of_size(memory) |
| 8 | + result = df.name.unique() |
| 9 | + wait(result, small_client, 10 * 60) |
| 10 | + |
| 11 | + |
| 12 | +def test_contains(small_client, convert_string): |
| 13 | + """String contains""" |
| 14 | + memory = cluster_memory(small_client) |
| 15 | + df = timeseries_of_size(memory) |
| 16 | + result = df.name.contains("a") |
| 17 | + wait(result, small_client, 10 * 60) |
| 18 | + |
| 19 | + |
| 20 | +def test_startswith(small_client, convert_string): |
| 21 | + """String starts with""" |
| 22 | + memory = cluster_memory(small_client) |
| 23 | + df = timeseries_of_size(memory) |
| 24 | + result = df.name.startswith("B") |
| 25 | + wait(result, small_client, 10 * 60) |
| 26 | + |
| 27 | + |
| 28 | +def test_filter(small_client, convert_string): |
| 29 | + """How fast can we filter a DataFrame?""" |
| 30 | + memory = cluster_memory(small_client) |
| 31 | + df = timeseries_of_size(memory) |
| 32 | + name = df.head(1).name.iloc[0] # Get first name that appears |
| 33 | + result = df[df.name == name] |
| 34 | + wait(result, small_client, 10 * 60) |
| 35 | + |
| 36 | + |
| 37 | +def test_value_counts(small_client, convert_string): |
| 38 | + """Value counts on string values""" |
| 39 | + memory = cluster_memory(small_client) |
| 40 | + df = timeseries_of_size(memory) |
| 41 | + result = df.name.value_counts() |
| 42 | + wait(result, small_client, 10 * 60) |
0 commit comments