Actually, this is a python version issue, I downgraded spark version and now working fine.