FormValidationAction method header produces NameError

Add the below statement at the beginning of your actions file.

from typing import Optional