Skip to content
This repository was archived by the owner on Jun 27, 2025. It is now read-only.

Commit 31fa43a

Browse files
author
yohplala
committed
Fixing broken AggStream.__init__ test cases.
1 parent 890733c commit 31fa43a

File tree

2 files changed

+28
-29
lines changed

2 files changed

+28
-29
lines changed

oups/aggstream/aggstream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
# It is not added in 'KEY_CONF_IN_PARAMS'.
7171
WRITE_PARAMS = set(write.__code__.co_varnames[: write.__code__.co_argcount])
7272
KEY_CONF_IN_PARAMS = {KEY_BIN_ON, KEY_SNAP_BY, KEY_AGG, KEY_POST} | WRITE_PARAMS
73-
# Parallel jobs.
73+
# Parallel jobs, at most using 75% of available cpus.
7474
KEY_MAX_P_JOBS = max(int(cpu_count() * 3 / 4), 1)
7575

7676

tests/test_aggstream/test_aggstream_init.py

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def always_false(**kwargs):
9494
},
9595
# ref_keys_config
9696
{
97-
str(Indexer("key1")): {
97+
Indexer("key1"): {
9898
KEY_BIN_ON_OUT: "ts",
9999
KEY_POST: None,
100100
"write_config": {
@@ -105,9 +105,9 @@ def always_false(**kwargs):
105105
},
106106
},
107107
# ref_agg_pd
108-
{str(Indexer("key1")): {"agg_out": ("val", SUM)}},
108+
{Indexer("key1"): {"agg_out": ("val", SUM)}},
109109
# ref_filter_apps
110-
{NO_FILTER_ID: FilterApp([str(Indexer("key1"))], "NA")},
110+
{NO_FILTER_ID: FilterApp([Indexer("key1")], "NA")},
111111
),
112112
(
113113
# Test 2 /
@@ -161,7 +161,7 @@ def always_false(**kwargs):
161161
},
162162
# ref_keys_config
163163
{
164-
str(Indexer("key1_some_default")): {
164+
Indexer("key1_some_default"): {
165165
KEY_BIN_ON_OUT: "ts_dflt",
166166
KEY_POST: always_false,
167167
"write_config": {
@@ -171,7 +171,7 @@ def always_false(**kwargs):
171171
KEY_DUPLICATES_ON: "ts_dflt",
172172
},
173173
},
174-
str(Indexer("key2_only_specific")): {
174+
Indexer("key2_only_specific"): {
175175
KEY_BIN_ON_OUT: None,
176176
KEY_POST: None,
177177
"write_config": {
@@ -181,7 +181,7 @@ def always_false(**kwargs):
181181
KEY_DUPLICATES_ON: "ts_spec",
182182
},
183183
},
184-
str(Indexer("key3_only_default")): {
184+
Indexer("key3_only_default"): {
185185
KEY_BIN_ON_OUT: "bin_out_spec",
186186
KEY_POST: always_true,
187187
"write_config": {
@@ -191,7 +191,7 @@ def always_false(**kwargs):
191191
KEY_DUPLICATES_ON: "bin_out_spec",
192192
},
193193
},
194-
str(Indexer("key4_most_default")): {
194+
Indexer("key4_most_default"): {
195195
KEY_BIN_ON_OUT: "ts_dflt",
196196
KEY_POST: always_true,
197197
"write_config": {
@@ -204,19 +204,19 @@ def always_false(**kwargs):
204204
},
205205
# ref_agg_pd
206206
{
207-
str(Indexer("key1_some_default")): {"out_spec": ("in_spec", FIRST)},
208-
str(Indexer("key2_only_specific")): {"out_spec": ("in_spec", FIRST)},
209-
str(Indexer("key3_only_default")): {"out_dflt": ("in_dflt", LAST)},
210-
str(Indexer("key4_most_default")): {"out_dflt": ("in_dflt", LAST)},
207+
Indexer("key1_some_default"): {"out_spec": ("in_spec", FIRST)},
208+
Indexer("key2_only_specific"): {"out_spec": ("in_spec", FIRST)},
209+
Indexer("key3_only_default"): {"out_dflt": ("in_dflt", LAST)},
210+
Indexer("key4_most_default"): {"out_dflt": ("in_dflt", LAST)},
211211
},
212212
# ref_filter_apps
213213
{
214214
NO_FILTER_ID: FilterApp(
215215
[
216-
str(Indexer("key1_some_default")),
217-
str(Indexer("key2_only_specific")),
218-
str(Indexer("key3_only_default")),
219-
str(Indexer("key4_most_default")),
216+
Indexer("key1_some_default"),
217+
Indexer("key2_only_specific"),
218+
Indexer("key3_only_default"),
219+
Indexer("key4_most_default"),
220220
],
221221
"NA",
222222
),
@@ -280,7 +280,7 @@ def always_false(**kwargs):
280280
},
281281
# ref_keys_config
282282
{
283-
str(Indexer("key1_some_default")): {
283+
Indexer("key1_some_default"): {
284284
KEY_BIN_ON_OUT: "ts_dflt",
285285
KEY_POST: always_false,
286286
"write_config": {
@@ -290,7 +290,7 @@ def always_false(**kwargs):
290290
KEY_DUPLICATES_ON: "ts_dflt",
291291
},
292292
},
293-
str(Indexer("key2_only_specific")): {
293+
Indexer("key2_only_specific"): {
294294
KEY_BIN_ON_OUT: None,
295295
KEY_POST: None,
296296
"write_config": {
@@ -300,7 +300,7 @@ def always_false(**kwargs):
300300
KEY_DUPLICATES_ON: "ts_spec",
301301
},
302302
},
303-
str(Indexer("key3_only_default")): {
303+
Indexer("key3_only_default"): {
304304
KEY_BIN_ON_OUT: "bin_out_spec",
305305
KEY_POST: always_true,
306306
"write_config": {
@@ -310,7 +310,7 @@ def always_false(**kwargs):
310310
KEY_DUPLICATES_ON: "bin_out_spec",
311311
},
312312
},
313-
str(Indexer("key4_most_default")): {
313+
Indexer("key4_most_default"): {
314314
KEY_BIN_ON_OUT: "ts_dflt",
315315
KEY_POST: always_true,
316316
"write_config": {
@@ -323,22 +323,22 @@ def always_false(**kwargs):
323323
},
324324
# ref_agg_pd
325325
{
326-
str(Indexer("key1_some_default")): {"out_spec": ("in_spec", FIRST)},
327-
str(Indexer("key2_only_specific")): {"out_spec": ("in_spec", FIRST)},
328-
str(Indexer("key3_only_default")): {"out_dflt": ("in_dflt", LAST)},
329-
str(Indexer("key4_most_default")): {"out_dflt": ("in_dflt", LAST)},
326+
Indexer("key1_some_default"): {"out_spec": ("in_spec", FIRST)},
327+
Indexer("key2_only_specific"): {"out_spec": ("in_spec", FIRST)},
328+
Indexer("key3_only_default"): {"out_dflt": ("in_dflt", LAST)},
329+
Indexer("key4_most_default"): {"out_dflt": ("in_dflt", LAST)},
330330
},
331331
# ref_filter_apps
332332
{
333333
"filter1": FilterApp(
334334
[
335-
str(Indexer("key1_some_default")),
336-
str(Indexer("key2_only_specific")),
337-
str(Indexer("key3_only_default")),
335+
Indexer("key1_some_default"),
336+
Indexer("key2_only_specific"),
337+
Indexer("key3_only_default"),
338338
],
339339
"NA",
340340
),
341-
"filter2": FilterApp([str(Indexer("key4_most_default"))], "NA"),
341+
"filter2": FilterApp([Indexer("key4_most_default")], "NA"),
342342
},
343343
),
344344
],
@@ -378,7 +378,6 @@ def test_aggstream_init(
378378
assert getattr(res_grouper, attr) == ref_grouper_attr[attr]
379379
for key, ref in ref_keys_config.items():
380380
del res_keys_config[key]["seg_config"]
381-
del res_keys_config[key]["dirpath"]
382381
assert res_keys_config[key] == ref
383382
ref_agg_buffers = {
384383
"agg_n_rows": 0,

0 commit comments

Comments
 (0)