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

fix: Empty / NotEmpty operators for descriptions, tags [WEB-1751] #8090

Merged
merged 3 commits into from
Oct 9, 2023

Conversation

mapmeld
Copy link
Contributor

@mapmeld mapmeld commented Oct 6, 2023

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

  • Changes have been manually QA'd
  • User-facing API changes need the "User-facing API Change" label.
  • Release notes should be added as a separate file under docs/release-notes/.
    See Release Note for details.
  • Licenses should be included for new code which was copied and/or modified from any external code.

@mapmeld mapmeld added the to-cherry-pick Pull requests that need to be cherry-picked into the current release label Oct 6, 2023
@mapmeld mapmeld requested a review from a team as a code owner October 6, 2023 17:04
@mapmeld mapmeld requested a review from stoksc October 6, 2023 17:04
@cla-bot cla-bot bot added the cla-signed label Oct 6, 2023
@netlify
Copy link

netlify bot commented Oct 6, 2023

Deploy Preview for determined-ui ready!

Name Link
🔨 Latest commit b3440fc
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/6524146cb9135500089b2401
😎 Deploy Preview https://deploy-preview-8090--determined-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Comment on lines 365 to 366
queryString = "? ? OR ? ? ? OR ? ? ?"
queryArgs = append(queryArgs, bun.Safe(col), bun.Safe(oSQL))
Copy link
Contributor

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

Suggested change
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))

Copy link
Contributor

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.

Copy link
Contributor Author

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 ✅

Copy link
Contributor

@stoksc stoksc left a 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

case empty:
queryString = "? ? OR ? ? ? OR ? ? ?"
queryArgs = append(queryArgs, bun.Safe(col), bun.Safe(oSQL))
queryArgs = append(queryArgs, bun.Safe(col), bun.Safe(equal), "")
Copy link
Contributor

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

Suggested change
queryArgs = append(queryArgs, bun.Safe(col), bun.Safe(equal), "")
queryArgs = append(queryArgs, bun.Safe(col), bun.Safe(equal), "")

@mapmeld mapmeld enabled auto-merge (squash) October 9, 2023 14:57
@mapmeld mapmeld merged commit 0c54010 into main Oct 9, 2023
68 of 83 checks passed
@mapmeld mapmeld deleted the notEmptyOp branch October 9, 2023 15:20
dai-release bot pushed a commit that referenced this pull request Oct 9, 2023
@dannysauer dannysauer added this to the 0.26.2 milestone Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed to-cherry-pick Pull requests that need to be cherry-picked into the current release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants