-
Notifications
You must be signed in to change notification settings - Fork 356
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
fix: Empty / NotEmpty operators for descriptions, tags [WEB-1751] #8090
Conversation
✅ Deploy Preview for determined-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
master/internal/experiment_filter.go
Outdated
queryString = "? ? OR ? ? ? OR ? ? ?" | ||
queryArgs = append(queryArgs, bun.Safe(col), bun.Safe(oSQL)) |
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.
once you are in this empty case, just writing out the fragment is significantly more readable to me
queryString = "? ? OR ? ? ? OR ? ? ?" | |
queryArgs = append(queryArgs, bun.Safe(col), bun.Safe(oSQL)) | |
queryString = "? IS NULL OR ? = "" OR ? = []" | |
queryArgs = append(queryArgs, bun.Safe(col), bun.Safe(col), bun.Safe(col)) |
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 know that goes against what is happening here already, so i'm not blocking, just giving my 2c.
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 does look a lot neater ✅
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.
looks like it should work to me
master/internal/experiment_filter.go
Outdated
case empty: | ||
queryString = "? ? OR ? ? ? OR ? ? ?" | ||
queryArgs = append(queryArgs, bun.Safe(col), bun.Safe(oSQL)) | ||
queryArgs = append(queryArgs, bun.Safe(col), bun.Safe(equal), "") |
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.
total nit, it looks like equal
and notEqual
are used to match on the input format, so using them in the output query is maybe unintended coupling
queryArgs = append(queryArgs, bun.Safe(col), bun.Safe(equal), "") | |
queryArgs = append(queryArgs, bun.Safe(col), bun.Safe(equal), "") |
Description
The experiment filters for empty / not-empty were queries for NULL / IS NOT NULL
For description we should also consider an empty string
For tags we should consider the string "[]" to be empty
Test Plan
Filter a project's experiments by description empty / is not empty
Filter a project's experiments by tags empty / is not empty
Checklist
docs/release-notes/
.See Release Note for details.