The magnetic field in a solenoid has a north pole, but the polarity of a solenoid valve does not matter. That’s because the polarity induced in the core of the solenoid reverses if the current in the coil reverses, so the motion of the core is the same either way.