@@ -582,7 +582,7 @@ def build_mock_input_with_fg(
582
582
inputs = defaultdict (dict )
583
583
single_id_fields = {user_id , item_id }
584
584
for feature in features :
585
- if type (feature ) == IdFeature :
585
+ if type (feature ) is IdFeature :
586
586
is_multi = (
587
587
random .random () < 0.5 and feature .inputs [0 ] not in single_id_fields
588
588
)
@@ -594,22 +594,22 @@ def build_mock_input_with_fg(
594
594
vocab_list = feature .config .vocab_list ,
595
595
multival_sep = chr (29 ),
596
596
)
597
- elif type (feature ) == RawFeature :
597
+ elif type (feature ) is RawFeature :
598
598
side , name = feature .side_inputs [0 ]
599
599
inputs [side ][name ] = RawMockInput (
600
600
name ,
601
601
value_dim = feature .config .value_dim ,
602
602
multival_sep = chr (29 ),
603
603
)
604
- elif type (feature ) == ComboFeature :
604
+ elif type (feature ) is ComboFeature :
605
605
for side , input_name in feature .side_inputs :
606
606
if input_name in inputs [side ]:
607
607
continue
608
608
is_multi = random .random () < 0.5 and input_name not in single_id_fields
609
609
inputs [side ][input_name ] = IdMockInput (
610
610
input_name , is_multi = is_multi , multival_sep = chr (29 )
611
611
)
612
- elif type (feature ) == LookupFeature :
612
+ elif type (feature ) is LookupFeature :
613
613
for i , (side , input_name ) in enumerate (feature .side_inputs ):
614
614
if input_name in inputs [side ]:
615
615
continue
@@ -627,7 +627,7 @@ def build_mock_input_with_fg(
627
627
inputs [side ][input_name ] = IdMockInput (
628
628
input_name , is_multi = is_multi , multival_sep = chr (29 )
629
629
)
630
- elif type (feature ) == MatchFeature :
630
+ elif type (feature ) is MatchFeature :
631
631
for i , (side , input_name ) in enumerate (feature .side_inputs ):
632
632
if input_name in inputs [side ]:
633
633
continue
@@ -637,14 +637,14 @@ def build_mock_input_with_fg(
637
637
inputs [side ][input_name ] = IdMockInput (
638
638
input_name , multival_sep = chr (29 )
639
639
)
640
- elif type (feature ) == ExprFeature :
640
+ elif type (feature ) is ExprFeature :
641
641
for side , input_name in feature .side_inputs :
642
642
if input_name in inputs [side ]:
643
643
continue
644
644
inputs [side ][input_name ] = RawMockInput (
645
645
input_name , multival_sep = chr (29 )
646
646
)
647
- elif type (feature ) == TokenizeFeature :
647
+ elif type (feature ) is TokenizeFeature :
648
648
side , name = feature .side_inputs [0 ]
649
649
inputs [side ][name ] = IdMockInput (
650
650
name ,
0 commit comments