@@ -385,15 +385,17 @@ def capture(*args: Any, **kwargs: Any) -> Any:
385385
386386
387387@onlyCUDA
388+ @pytest .mark .parametrize ("num_neighbors" , [[- 1 , - 1 ], [3 , 3 ]])
388389def test_cugraph_sampler_uses_original_cutoff (
389390 temporal_data : RelationalData ,
391+ num_neighbors : list [int ],
390392) -> None :
391393 _require_rapids ()
392394 data = temporal_data .cuda ()
393395 task_table = _table (
394396 {
395- "entity" : [0 , 0 ],
396- "cutoff" : pd .to_datetime ([2 , 10 ], unit = "s" ).tolist (),
397+ "entity" : [0 , 0 , 0 ],
398+ "cutoff" : pd .to_datetime ([0 , 2 , 10 ], unit = "s" ).tolist (),
397399 },
398400 {"entity" : Stype .id , "cutoff" : Stype .datetime },
399401 )
@@ -405,19 +407,22 @@ def test_cugraph_sampler_uses_original_cutoff(
405407 "table" : "roots" ,
406408 "table_column" : "root_id" ,
407409 },
408- num_neighbors = [ - 1 , - 1 ] ,
410+ num_neighbors = num_neighbors ,
409411 task_time_column = "cutoff" ,
410412 temporal_strategy = "uniform" ,
411413 )
412414
413415 assert _rows (
414416 output .related_tables .tables ["first" ], EXAMPLE_ID , "first_id"
415- ) == [(0 , 11 ), (0 , 12 ), (1 , 10 ), (1 , 11 ), (1 , 12 )]
417+ ) == [(1 , 11 ), (1 , 12 ), (2 , 10 ), (2 , 11 ), (2 , 12 )]
416418 # The second-hop time (8) is newer than the first-hop time (3), but is
417419 # valid because every hop uses the task cutoff (10).
418420 assert _rows (
419421 output .related_tables .tables ["second" ], EXAMPLE_ID , "second_id"
420- ) == [(1 , 20 ), (1 , 21 )]
422+ ) == [(2 , 20 ), (2 , 21 )]
423+ assert _rows (
424+ output .related_tables .tables ["roots" ], EXAMPLE_ID , "root_id"
425+ ) == [(0 , 0 ), (1 , 0 ), (2 , 0 )]
421426
422427
423428@onlyCUDA
0 commit comments