Skip to content

Commit b95d5e4

Browse files
authored
fix: rename countDistinct to countdistinct in allowed functions (#211)
### TL;DR We check for allowed lowercased functions so had to change the `countDistinct` function name to lowercase `countdistinct` in the allowed functions map. ### What changed? Modified the `allowedFunctions` map in `internal/common/utils.go` to use lowercase `countdistinct` instead of the previously camelCase `countDistinct`. This ensures consistent naming convention for function names. ### How to test? 1. Verify that any code using the `countdistinct` function continues to work properly 2. Check that any API calls or queries using this function name are properly recognized 3. Run existing tests to ensure no regressions ### Why make this change? This change standardizes the function naming convention to use all lowercase for function names in the `allowedFunctions` map. This improves consistency with other function names and likely fixes case-sensitivity issues when these function names are used in queries or API calls. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved function name validation to recognize only lowercase "countdistinct" as an allowed function, ensuring consistent and accurate query validation. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents dace8a7 + 7fa05a2 commit b95d5e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/common/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func SliceToChunks[T any](values []T, chunkSize int) [][]T {
2525
var allowedFunctions = map[string]struct{}{
2626
"sum": {},
2727
"count": {},
28-
"countDistinct": {},
28+
"countdistinct": {},
2929
"avg": {},
3030
"max": {},
3131
"min": {},

0 commit comments

Comments
 (0)