-
Notifications
You must be signed in to change notification settings - Fork 3
/
test_dataset_consistency.py
582 lines (395 loc) · 26.3 KB
/
test_dataset_consistency.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
import dask.dataframe as ddf
import numpy as np
import pandas as pd
import pytest
from distributed import Client
from scipy.sparse import csr_matrix
from Utils.dataset import ContentWiseImpressions, read_dataset
from Utils.config import configure_dask_cluster
@pytest.fixture
def dataset() -> ContentWiseImpressions:
dataset = read_dataset(ContentWiseImpressions.Variant.CW10M, use_items=True)
return dataset
@pytest.fixture(scope="module")
def dask_client() -> Client:
client, cluster = configure_dask_cluster(use_processes=True)
yield client
client.close(), cluster.close()
def test_consistency_interactions_index(dataset: ContentWiseImpressions):
na_index_mask: ddf.Series = dataset.interactions.index.isna()
min_index: int = dataset.interactions.index.min()
max_index: int = dataset.interactions.index.max()
(na_index_mask,
min_index,
max_index,) = ddf.compute(na_index_mask,
min_index,
max_index,)
assert not na_index_mask.any()
def test_consistency_interactions_user_ids(dataset: ContentWiseImpressions):
expected_number_users: int = dataset.metadata["num_users"]
na_user_id_mask: ddf.Series = dataset.interactions.user_id.isna()
invalid_user_id_mask: ddf.Series = ((dataset.interactions.user_id < 0) |
(dataset.interactions.user_id > expected_number_users))
(na_user_id_mask,
invalid_user_id_mask,) = ddf.compute(na_user_id_mask,
invalid_user_id_mask,)
assert not na_user_id_mask.any()
assert not invalid_user_id_mask.any()
def test_consistency_interactions_item_ids(dataset: ContentWiseImpressions):
expected_number_items: int = dataset.metadata["num_items"]
na_item_id_mask: ddf.Series = dataset.interactions.item_id.isna()
invalid_item_id_mask: ddf.Series = ((dataset.interactions.item_id < 0) |
(dataset.interactions.item_id > expected_number_items))
(na_item_id_mask,
invalid_item_id_mask,) = ddf.compute(na_item_id_mask,
invalid_item_id_mask,)
assert not na_item_id_mask.any()
assert not invalid_item_id_mask.any()
def test_consistency_interactions_item_types(dataset: ContentWiseImpressions):
na_item_type_mask: ddf.Series = dataset.interactions.item_type.isna()
invalid_item_types_mask: ddf.Series = (dataset.interactions
.item_type
.map(lambda item_type: item_type not in {0, 1, 2, 3}))
(na_item_type_mask,
invalid_item_types_mask,) = ddf.compute(na_item_type_mask,
invalid_item_types_mask,)
assert not na_item_type_mask.any()
assert not invalid_item_types_mask.any()
def test_consistency_interactions_series_ids(dataset: ContentWiseImpressions):
expected_number_series: int = dataset.metadata["num_series"]
na_series_id_mask: ddf.Series = dataset.interactions.series_id.isna()
invalid_series_id_mask: ddf.Series = ((dataset.interactions.series_id < 0) |
(dataset.interactions.series_id > expected_number_series))
(na_series_id_mask,
invalid_series_id_mask,) = ddf.compute(na_series_id_mask,
invalid_series_id_mask,)
assert not na_series_id_mask.any()
assert not invalid_series_id_mask.any()
def test_consistency_interactions_episode_numbers(dataset: ContentWiseImpressions):
na_episode_number_mask: ddf.Series = dataset.interactions.episode_number.isna()
invalid_episode_number_mask: ddf.Series = (dataset.interactions.episode_number < 0)
(na_episode_number_mask,
invalid_episode_number_mask,) = ddf.compute(na_episode_number_mask,
invalid_episode_number_mask,)
assert not na_episode_number_mask.any()
assert not invalid_episode_number_mask.any()
def test_consistency_interactions_series_length(dataset: ContentWiseImpressions):
na_series_length_mask: ddf.Series = dataset.interactions.series_length.isna()
invalid_series_length_mask: ddf.Series = (dataset.interactions.series_length < 0)
(na_series_length_mask,
invalid_series_length_mask,) = ddf.compute(na_series_length_mask,
invalid_series_length_mask,)
assert not na_series_length_mask.any()
assert not invalid_series_length_mask.any()
def test_consistency_interactions_recommendation_ids(dataset: ContentWiseImpressions):
expected_number_recommendations: int = dataset.metadata["num_recommendations"]
na_recommendation_id_mask: ddf.Series = dataset.interactions.recommendation_id.isna()
invalid_recommendation_id_mask: ddf.Series = ((dataset.interactions.recommendation_id < -1) |
(dataset.interactions.recommendation_id > expected_number_recommendations))
(na_recommendation_id_mask,
invalid_recommendation_id_mask) = ddf.compute(na_recommendation_id_mask,
invalid_recommendation_id_mask,)
assert not na_recommendation_id_mask.any()
assert not invalid_recommendation_id_mask.any()
def test_consistency_interactions_interaction_types(dataset: ContentWiseImpressions):
na_interaction_type_mask: ddf.Series = dataset.interactions.interaction_type.isna()
invalid_interaction_type_mask: ddf.Series = (dataset.interactions
.interaction_type
.map(lambda interaction_type: interaction_type not in {0, 1, 2, 3}))
(na_interaction_type_mask,
invalid_interaction_type_mask,) = ddf.compute(na_interaction_type_mask,
invalid_interaction_type_mask,)
assert not na_interaction_type_mask.any()
assert not invalid_interaction_type_mask.any()
def test_consistency_interactions_explicit_ratings(dataset: ContentWiseImpressions):
# Explicit ratings values should only be set when the interaction type is "Rated" (2).
# We verify that all "rated" interactions have valid values (from 0.0 to 5.0 with steps of 0.5)
# For any other interaction, we verify that the value is -1.
na_explicit_ratings_mask: ddf.Series = dataset.interactions.explicit_rating.isna()
rated_interactions_explicit_ratings: ddf.Series = dataset.interactions[dataset.interactions.interaction_type ==
2].explicit_rating
rated_invalid_explicit_ratings_mask: ddf.Series = (rated_interactions_explicit_ratings
.map(lambda rating: rating not in np.linspace(0.0, 5.0,
num=11)))
other_interactions_explicit_rating = dataset.interactions[
dataset.interactions.interaction_type != 2].explicit_rating
other_invalid_explicit_ratings_mask: ddf.Series = (other_interactions_explicit_rating != -1.0)
(na_explicit_ratings_mask,
rated_invalid_explicit_ratings_mask,
other_invalid_explicit_ratings_mask,) = ddf.compute(na_explicit_ratings_mask,
rated_invalid_explicit_ratings_mask,
other_invalid_explicit_ratings_mask,)
assert not na_explicit_ratings_mask.any()
assert not rated_invalid_explicit_ratings_mask.any()
assert not other_invalid_explicit_ratings_mask.any()
def test_consistency_interactions_vision_factor(dataset: ContentWiseImpressions):
# Vision factor values should only be set when the interaction type is "Viewed" (0).
# We verify that all "viewed" interactions have valid values (from 0.0 to 1.0)
# For any other interaction, we verify that the value is -1.
na_vision_factor_mask: ddf.Series = dataset.interactions.vision_factor.isna()
viewed_interactions_vision_factors = dataset.interactions[dataset.interactions.interaction_type == 0].vision_factor
viewed_invalid_vision_factor_mask: ddf.Series = ((viewed_interactions_vision_factors < 0) |
(viewed_interactions_vision_factors > 5.0))
other_interactions_vision_factors = dataset.interactions[dataset.interactions.interaction_type != 0].vision_factor
other_invalid_vision_factor_mask: ddf.Series = (other_interactions_vision_factors != -1.0)
(na_vision_factor_mask,
viewed_invalid_vision_factor_mask,
other_invalid_vision_factor_mask,) = ddf.compute(na_vision_factor_mask,
viewed_invalid_vision_factor_mask,
other_invalid_vision_factor_mask,)
assert not na_vision_factor_mask.any()
assert not viewed_invalid_vision_factor_mask.any()
assert not other_invalid_vision_factor_mask.any()
def test_consistency_interactions_items_have_only_one_series(dataset: ContentWiseImpressions):
pairs_item_id_with_series_id = (dataset
.interactions[["item_id", "series_id"]]
.groupby("item_id")
.series_id
.agg(["min", "max"]))
invalid_pairs_mask = (pairs_item_id_with_series_id["min"] != pairs_item_id_with_series_id["max"])
(invalid_pairs_mask,) = ddf.compute(invalid_pairs_mask, scheduler="threads")
assert not invalid_pairs_mask.any()
def test_consistency_interactions_items_have_only_one_type(dataset: ContentWiseImpressions):
pairs_item_id_with_item_type = (dataset
.interactions[["item_id", "item_type"]]
.groupby("item_id")
.item_type
.agg(["min", "max"]))
invalid_pairs_mask = (pairs_item_id_with_item_type["min"] != pairs_item_id_with_item_type["max"])
(invalid_pairs_mask,) = ddf.compute(invalid_pairs_mask, scheduler="threads")
assert not invalid_pairs_mask.any()
def test_consistency_interactions_items_have_only_one_episode_number(dataset: ContentWiseImpressions):
pairs_item_id_with_episode_number = (dataset
.interactions[["item_id", "episode_number"]]
.groupby("item_id")
.episode_number
.agg(["min", "max"]))
invalid_pairs_mask = (pairs_item_id_with_episode_number["min"] != pairs_item_id_with_episode_number["max"])
(invalid_pairs_mask, ) = ddf.compute(invalid_pairs_mask, scheduler="threads")
assert not invalid_pairs_mask.any()
def test_consistency_interactions_items_have_same_series_length(dataset: ContentWiseImpressions):
pairs_item_id_with_series_length = (dataset
.interactions[["item_id", "series_length"]]
.groupby("item_id")
.series_length
.agg(["min", "max"]))
invalid_pairs_mask = (pairs_item_id_with_series_length["min"] != pairs_item_id_with_series_length["max"])
(invalid_pairs_mask,) = ddf.compute(invalid_pairs_mask, scheduler="threads")
assert not invalid_pairs_mask.any()
def test_consistency_interactions_episode_number_lower_than_series_length(dataset: ContentWiseImpressions):
invalid_pairs_mask = (dataset.interactions.episode_number >
dataset.interactions.series_length)
(invalid_pairs_mask,) = ddf.compute(invalid_pairs_mask, scheduler="threads")
assert not invalid_pairs_mask.any()
def test_consistency_impressions_direct_link_index(dataset: ContentWiseImpressions):
na_index_mask: ddf.Series = dataset.impressions_direct_link.index.isna()
(na_index_mask,) = ddf.compute(na_index_mask,)
assert not na_index_mask.any()
def test_consistency_impressions_direct_link_row_position(dataset: ContentWiseImpressions):
na_row_position_mask: ddf.Series = dataset.impressions_direct_link.row_position.isna()
row_position_less_than_zero_mask: ddf.Series = (dataset.impressions_direct_link.row_position < 0)
(na_row_position_mask,
row_position_less_than_zero_mask,) = ddf.compute(na_row_position_mask,
row_position_less_than_zero_mask,)
assert not na_row_position_mask.any(skipna=False)
assert not row_position_less_than_zero_mask.any(skipna=False)
def test_consistency_impressions_direct_link_recommendation_list_length(dataset: ContentWiseImpressions):
na_recommendation_list_length_mask: ddf.Series = dataset.impressions_direct_link.recommendation_list_length.isna()
recommendation_list_length_less_than_zero_mask: ddf.Series = (
dataset.impressions_direct_link.recommendation_list_length < 0)
(na_recommendation_list_length_mask,
recommendation_list_length_less_than_zero_mask,) = ddf.compute(na_recommendation_list_length_mask,
recommendation_list_length_less_than_zero_mask,)
assert not na_recommendation_list_length_mask.any(skipna=False)
assert not recommendation_list_length_less_than_zero_mask.any(skipna=False)
def test_consistency_impressions_direct_link_recommended_series(dataset: ContentWiseImpressions):
na_recommended_series_mask: ddf.Series = (dataset
.impressions_direct_link
.recommended_series_list
.map(lambda recommended_series_list: recommended_series_list.shape[0] > 0 and
np.any(np.isnan(recommended_series_list)),
meta=("na_recommended_series_mask", "bool")))
(na_recommended_series_mask,) = ddf.compute(na_recommended_series_mask,)
assert not na_recommended_series_mask.any(skipna=False)
def test_consistency_impressions_direct_link_recommended_lists_with_at_least_one_item(dataset: ContentWiseImpressions):
empty_recommendation_list_mask = (dataset
.impressions_direct_link
.recommended_series_list
.map(lambda recommended_series_list: recommended_series_list.shape[0] == 0,
meta=("actual_length_of_recommended_series", "bool")))
(empty_recommendation_list_mask,) = ddf.compute(empty_recommendation_list_mask)
assert not empty_recommendation_list_mask.any(skipna=False)
def test_consistency_impressions_direct_link_reported_length_equal_to_actual_length(dataset: ContentWiseImpressions):
recommendation_list_length = dataset.impressions_direct_link.recommendation_list_length
actual_length_of_recommended_series = (dataset
.impressions_direct_link
.recommended_series_list
.map(lambda series: series.shape[0],
meta=("actual_length_of_recommended_series", "int")))
impressions_with_mismatching_length_mask = (recommendation_list_length != actual_length_of_recommended_series)
(impressions_with_mismatching_length_mask,) = ddf.compute(impressions_with_mismatching_length_mask)
assert not impressions_with_mismatching_length_mask.any(skipna=False)
def test_consistency_impressions_non_direct_link_index(dataset: ContentWiseImpressions):
na_index_mask: ddf.Series = dataset.impressions_non_direct_link.index.isna()
(na_index_mask,) = ddf.compute(na_index_mask, )
assert not na_index_mask.any()
def test_consistency_impressions_non_direct_link_row_position(dataset: ContentWiseImpressions):
na_row_position_mask: ddf.Series = dataset.impressions_non_direct_link.row_position.isna()
row_position_less_than_zero_mask: ddf.Series = (dataset.impressions_direct_link.row_position < 0)
(na_row_position_mask,
row_position_less_than_zero_mask,) = ddf.compute(na_row_position_mask,
row_position_less_than_zero_mask, )
assert not na_row_position_mask.any(skipna=False)
assert not row_position_less_than_zero_mask.any(skipna=False)
def test_consistency_impressions_non_direct_link_recommendation_list_length(dataset: ContentWiseImpressions):
na_recommendation_list_length_mask: ddf.Series = (dataset
.impressions_non_direct_link
.recommendation_list_length
.isna())
recommendation_list_length_less_than_zero_mask: ddf.Series = (dataset
.impressions_non_direct_link
.recommendation_list_length < 0)
(na_recommendation_list_length_mask,
recommendation_list_length_less_than_zero_mask,) = ddf.compute(na_recommendation_list_length_mask,
recommendation_list_length_less_than_zero_mask, )
assert not na_recommendation_list_length_mask.any(skipna=False)
assert not recommendation_list_length_less_than_zero_mask.any(skipna=False)
def test_consistency_impressions_non_direct_link_recommended_series(dataset: ContentWiseImpressions):
na_recommended_series_map_mask: ddf.Series = (dataset
.impressions_non_direct_link
.recommended_series_list
.map(lambda recommended_series_list: np.any(np.isnan(recommended_series_list)),
meta=("na_recommended_series_mask", "bool")))
(na_recommended_series_map_mask,) = ddf.compute(na_recommended_series_map_mask)
assert not na_recommended_series_map_mask.any(skipna=False)
def test_consistency_impressions_non_direct_link_recommended_lists_with_at_least_one_item(dataset: ContentWiseImpressions):
empty_recommendation_list_mask = (dataset
.impressions_non_direct_link
.recommended_series_list
.map(lambda recommended_series_list: recommended_series_list.shape[0] == 0,
meta=("empty_recommendation_list_mask", "bool")))
(empty_recommendation_list_mask,) = ddf.compute(empty_recommendation_list_mask,)
assert not empty_recommendation_list_mask.any(skipna=False)
def test_consistency_impressions_non_direct_link_reported_length_equal_to_actual_length(dataset: ContentWiseImpressions):
recommendation_list_length = dataset.impressions_non_direct_link.recommendation_list_length
actual_length_of_recommended_series = (dataset
.impressions_non_direct_link
.recommended_series_list
.map(lambda series: series.shape[0],
meta=("actual_length_of_recommended_series", "int")))
impressions_with_mismatching_length_mask = (recommendation_list_length != actual_length_of_recommended_series)
(impressions_with_mismatching_length_mask,) = ddf.compute(impressions_with_mismatching_length_mask)
assert not impressions_with_mismatching_length_mask.any(skipna=False)
def test_consistency_interactions_impressions_direct_link_interacted_items_are_inside_recommendation_list(dataset: ContentWiseImpressions):
def get_series_index_on_recommendation_list(row) -> int:
results: np.ndarray = np.where(row.recommended_series_list == row.series_id)
indices: np.ndarray = results[0]
if len(indices) == 0:
return -1
return indices[0]
dataset: ddf.DataFrame = dataset.interactions.merge(right=dataset.impressions_direct_link,
how="inner",
left_on="recommendation_id",
right_index=True)
dataset["recommendation_index"] = dataset.apply(get_series_index_on_recommendation_list,
axis="columns",
meta=("recommendation_index", "int32"))
series_not_found_on_recommendation_mask: ddf.Series = (dataset.recommendation_index == -1)
(series_not_found_on_recommendation_mask,) = ddf.compute(series_not_found_on_recommendation_mask)
assert not series_not_found_on_recommendation_mask.any(skipna=False)
def test_consistency_interactions_impressions_non_direct_link_indirect_impressions_exist(dataset: ContentWiseImpressions):
interactions: csr_matrix = dataset.URM["train"] + dataset.URM["validation"] + dataset.URM["test"]
impressions_non_direct_link: csr_matrix = dataset.URM["impressions_non_direct_link"].copy()
impressions_non_direct_link.data = np.ones_like(impressions_non_direct_link.data, dtype=np.int32)
indirect_impressions_mask: np.ndarray = (interactions + impressions_non_direct_link).data > 1
print(indirect_impressions_mask, indirect_impressions_mask.shape)
print(indirect_impressions_mask[indirect_impressions_mask].shape)
assert indirect_impressions_mask.any()
def test_consistency_interactions_impressions_direct_link_only_common_recommendation_ids(dataset: ContentWiseImpressions):
unique_shared_recommendation_ids = (dataset
.interactions
.merge(right=dataset.impressions_direct_link,
how="inner",
left_on="recommendation_id",
right_index=True)
.recommendation_id
.unique())
# We add the missing recommendation id (-1) as part of a different recommendation id. The merge above removes this
# value, we add its count here.
num_unique_shared_recommendation_ids = unique_shared_recommendation_ids.shape[0] + 1
(num_unique_shared_recommendation_ids,) = ddf.compute(num_unique_shared_recommendation_ids)
assert num_unique_shared_recommendation_ids == dataset.metadata["num_recommendations"]
def test_consistency_interactions_impressions_non_direct_link_only_common_user_ids(dataset: ContentWiseImpressions):
# NOTE: We calculate uniqueness of user_ids on the impressions_non_direct_link due to the high impact on memory
# that the merges take if not done in this way.
unique_user_ids_on_impressions_non_direct_link = (dataset
.impressions_non_direct_link
.reset_index(drop=False)
.user_id
.unique()
.to_frame(name='user_id'))
unique_shared_user_ids = (dataset
.interactions
.merge(right=unique_user_ids_on_impressions_non_direct_link,
how="inner",
left_on="user_id",
right_on="user_id")
.user_id
.unique())
num_unique_shared_user_ids = unique_shared_user_ids.shape[0]
(num_unique_shared_user_ids,) = ddf.compute(num_unique_shared_user_ids)
assert num_unique_shared_user_ids == dataset.metadata["num_users"]
def test_na():
with pytest.raises(AssertionError):
should_fail = np.array([1, np.NaN, 2, 3])
should_fail_mask = np.isnan(np.array(should_fail))
assert not should_fail_mask.any()
def test_na_pd():
with pytest.raises(AssertionError):
should_fail = pd.Series(np.array([1, np.NaN, 2, 3]))
should_fail_mask = should_fail.isna()
assert not should_fail_mask.any()
def test_na_dask():
with pytest.raises(AssertionError):
should_fail = ddf.from_pandas(pd.Series(np.array([1, np.NaN, 2, 3])), npartitions=1)
should_fail_mask = should_fail.isna().compute()
assert not should_fail_mask.any()
def test_na_2_np():
with pytest.raises(AssertionError):
should_fail = np.array([np.NaN, np.NaN])
should_fail_mask = np.isnan(np.array(should_fail))
assert not should_fail_mask.any()
def test_na_2_pd():
with pytest.raises(AssertionError):
should_fail = pd.Series(np.array([np.NaN, np.NaN]))
should_fail_mask = should_fail.isna()
assert not should_fail_mask.any()
def test_na_2_dask():
with pytest.raises(AssertionError):
should_fail = ddf.from_pandas(pd.Series(np.array([np.NaN, np.NaN])), npartitions=1)
should_fail_mask = should_fail.isna().compute()
assert not should_fail_mask.any()
def test_na_3_np():
should_pass = np.array([])
should_pass_mask = np.isnan(np.array(should_pass))
assert not should_pass_mask.any()
def test_na_3_pd():
should_pass = pd.Series(np.array([]))
should_pass_mask = should_pass.isna()
assert not should_pass_mask.any()
def test_na_3_dask():
should_pass = ddf.from_pandas(pd.Series(np.array([])), npartitions=1)
should_pass_mask = should_pass.isna().compute()
assert not should_pass_mask.any()
def test_na_4_np():
should_pass = np.array([1, 2, 3])
should_pass_mask = np.isnan(np.array(should_pass))
assert not should_pass_mask.any()
def test_na_4_pd():
should_pass = pd.Series(np.array([1, 2, 3]))
should_pass_mask = should_pass.isna()
assert not should_pass_mask.any()
def test_na_4_dask():
should_pass = ddf.from_pandas(pd.Series(np.array([1, 2, 3])), npartitions=1)
should_pass_mask = should_pass.isna().compute()
assert not should_pass_mask.any()