Skip to content
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

test: add failing test for empty group by #634

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sagikazarmark
Copy link
Member

Overview

Empty group bys lead to failing queries.

@sagikazarmark sagikazarmark added the kind/bug Something isn't working label Feb 22, 2024
@@ -123,6 +123,11 @@ func (d createMeterView) toSQL() (string, []interface{}, error) {
orderBy := []string{"windowstart", "windowend", "subject"}
sortedGroupBy := sortedKeys(d.GroupBy)
for _, k := range sortedGroupBy {
// Skip empty keys
if k == "" {
continue
Copy link
Contributor

@hekike hekike Feb 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would return error. I think from an operational perspective, it's better to be strict and surface issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants