@@ -826,14 +826,7 @@ def test_dual_conditions_eq_and_ne(df, right):
826
826
"""Test output for equal and not equal conditions."""
827
827
assume (not df .empty )
828
828
assume (not right .empty )
829
-
830
829
eq_A , eq_B , ne_A , ne_B = ("B" , "Numeric" , "E" , "Dates" )
831
-
832
- # nulls are not preserved for multiple conditions
833
- # that involve `!=`
834
- df = df .dropna (subset = ["B" , "E" ])
835
- right = right .dropna (subset = ["Numeric" , "Dates" ])
836
-
837
830
expected = (
838
831
df .assign (t = 1 )
839
832
.merge (right .assign (t = 1 ), on = "t" )
@@ -848,8 +841,9 @@ def test_dual_conditions_eq_and_ne(df, right):
848
841
how = "inner" ,
849
842
sort_by_appearance = True ,
850
843
)
851
-
852
- actual = actual .filter ([eq_A , eq_B , ne_A , ne_B ])
844
+ # nulls are not preserved for multiple conditions
845
+ # that involve `!=`
846
+ actual = actual .filter ([eq_A , eq_B , ne_A , ne_B ]).dropna ()
853
847
assert_frame_equal (actual , actual )
854
848
855
849
@@ -861,12 +855,6 @@ def test_dual_conditions_ne_and_eq(df, right):
861
855
assume (not right .empty )
862
856
863
857
eq_A , eq_B , ne_A , ne_B = ("B" , "Numeric" , "E" , "Dates" )
864
-
865
- # nulls are not preserved for multiple conditions
866
- # that involve `!=`
867
- df = df .dropna (subset = ["B" , "E" ])
868
- right = right .dropna (subset = ["Numeric" , "Dates" ])
869
-
870
858
expected = (
871
859
df .assign (t = 1 )
872
860
.merge (right .assign (t = 1 ), on = "t" )
@@ -881,6 +869,7 @@ def test_dual_conditions_ne_and_eq(df, right):
881
869
how = "inner" ,
882
870
sort_by_appearance = True ,
883
871
)
884
-
885
- actual = actual .filter ([eq_A , eq_B , ne_A , ne_B ])
872
+ # nulls are not preserved for multiple conditions
873
+ # that involve `!=`
874
+ actual = actual .filter ([eq_A , eq_B , ne_A , ne_B ]).dropna ()
886
875
assert_frame_equal (expected , actual )
0 commit comments