To force the compiler to parse the filters correctly, add an additional set of parentheses around filter conditions. E.g.
(df .filter('(A=1 or B=3)') .filter('A=0') .show() )