Take a Multimeter and put it on the diode setting. Check the coil in each direction to see if there is a diode built into the coil (there probably isn’t). Next use the multimeter continuity setting to check for continuity between the main casing of the valve and each lead (there probably won’t be continuity).
If there is no diode and no continuity to the block then there is no polarity. You can use either wire as ground.