The problem is that you are not explicitly returning any value in the case that your condition(s) are not met. In this case it will implicitly return NULL (None) for any value of "Street1" that is not "0" or None, but NULLs are not permitted in the "Verified" field for which (I'm guessing) you are running this calculation.
You can cater for this by adding an else
clause to your if
, or just have a default return
statement at the end where you make sure you default to returning something other than NULL (or None).
Something like:
def check(street):
if street is None or street == "0":
return "V"
return "X"
(replace "X" with whatever non-"V" value you want - even return ""
would be OK)
Alternatively, if you really want NULL values, and the dataset is a GDB that can handle NULL values, you will need to redefine the field properties to allow NULL values for the "Verified" field.
return 'V' if !Street! in [None, "0"] else 'some other value maybe None or ""'