def or_func(left: Column, right: Any) -> Column: if not isinstance(right, Column) and pd.isna(right): return SF.lit(False) else: scol = left | SF.lit(right) return F.when(left.isNull() | scol.isNull(), False).otherwise(scol)
def rpow_func(left: Column, right: Any) -> Column: return (F.when(left.isNull(), np.nan).when(SF.lit(right == 1), right).otherwise( Column.__rpow__(left, right)))