I'm attempting to run a script to calculate a field that is conditional. If float2 is available I want to calculate the ratio of float1/float2, if it is null I want to use the ratio of float1/float3, and then leave null if both float2 and float3 are null.
The script doesn't immediately fail when running, but does error out after a few thousand records with the following:

Expression:
calc(!float1!, !text1!, !float2!, !float3!)
Code Block:
def calc(f1, t1, f2, f3):
if f1 > 0 and t1 == "H":
if f2:
return f1 / f2
elif f3:
return f1 / f3
else:
return None
else:
return None
Any ideas on what is happening here or how to address it? !float1! is indeed a float, so my first thought that maybe there was some hard coded scientific notation in there doesn't seem to be an issue. Thanks!