-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
config: Audit all interpolation functions for list/map behavior #7834
Conversation
@@ -487,11 +491,16 @@ func interpolationFuncDistinct() ast.Function { | |||
var list []string | |||
|
|||
if len(args) != 1 { | |||
return nil, fmt.Errorf("distinct() excepts only one argument.") | |||
return nil, fmt.Errorf("accepts only one argument.") |
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.
distinct() accepts?
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.
I learned that the caller prepends the function name automatically, so we were getting stutter in the resulting err messages.
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.
Confirmed error prints like this:
Errors:
* distinct: only works for flat lists, this list contains elements of type list in:
${distinct(list(list(","), list(",")))}
Minor nitpicks about error message consistency and a couple of typos in the docs, but otherwise LGTM! |
- `distinct()` - error on non-flat lists - `element()` - error on non-flat lists - `join()` - error on non-flat lists - `length()` - support maps - `lookup()` - error on non-flat maps - `values()` - error on non-flat maps
3ca1de0
to
8803076
Compare
Okay addressed all the comments - will merge on green. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
distinct()
- error on non-flat listselement()
- error on non-flat listsjoin()
- error on non-flat listslength()
- support mapslookup()
- error on non-flat mapsvalues()
- error on non-flat maps