I met a problem while using spark with python3 in my project. In a Key-Value pair, like
for i in value:
Your return statement cannot be inside the loop; otherwise, it returns after the first iteration, never to make it to the second iteration.
What you could try is this
result =  for i in value: result.append((i,label)) return result
result would be a list of all of the tuples created inside the loop.