-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proposed changes on empty value handling for opensanctions search #863
Conversation
} | ||
} | ||
|
||
if nullFieldRead >= 2 { | ||
if emptyFieldRead == nbEvaluatedFields { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this condition was incorrect if one of the two inputs was left empty
@@ -43,9 +43,5 @@ func (f StringConcat) Evaluate(ctx context.Context, arguments ast.Arguments) (an | |||
} | |||
} | |||
|
|||
if sb.Len() == 0 { | |||
return MakeEvaluateError(ast.ErrNullFieldRead) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we actually used to have a lot of those, they have been rather deprecated in favor of "cleanly" returning nil in Evaluate if a nil value is "read" (AKA some nil received in a required input or actual nil value read in the logic of the function)
I was not able to reproduce manually the 400 on empty inputs, do you have the query JSON handy? |
Hmm no, I'll check a bit later |
@apognu in short what seems to happens in the main branch is that in some cases at least we are left with an empty slice of queries, for which yente returns a 400 code. |
7b0cf1b
to
7f69d12
Compare
The diff got kind of big, but the premise here is basically: