Skip to content

Commit eb4801c

Browse files
fix fail_condition
return True when an exception should be raised
1 parent b0ac3a4 commit eb4801c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/pyspark/rdd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,10 +699,10 @@ def fail_condition(x):
699699
return False
700700
elif mode == 'strict':
701701
def fail_condition(x):
702-
return x == 0
702+
return x != 0
703703
elif mode == 'grep':
704704
def fail_condition(x):
705-
return x == 0 or x == 1
705+
return x != 0 and x != 1
706706
else:
707707
raise ValueError("mode must be one of 'permissive', 'strict' or 'grep'.")
708708

0 commit comments

Comments
 (0)