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

BED-4366 -- parse negative numbers in Cypher queries #661

Merged
merged 8 commits into from
Jul 22, 2024

Conversation

maffkipp
Copy link
Contributor

Description

Our arithmetic expression parsing for cypher queries was silently dropping the operator from negative numbers. This change adds a model for unary expressions that will carry the operator through and allow us to handle it as a separate case in the backend.

Motivation and Context

Some of our saved queries use negative numbers for matching by property values, and we are currently returning unexpected results to the user when they use those queries.

How Has This Been Tested?

Additional positive test cases have been added to confirm we now allow negative numbers, and that this does not otherwise impact the way we parse arithmetic expressions.

Screenshots (if appropriate):

Types of changes

  • Chore (a change that does not modify the application functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • Documentation updates are needed, and have been made accordingly.
  • I have added and/or updated tests to cover my changes.
  • All new and existing tests passed.
  • My changes include a database migration.

@maffkipp maffkipp self-assigned this Jun 21, 2024
@maffkipp maffkipp changed the title BED-4366 -- Parse negative numbers in Cypher queries BED-4366 -- parse negative numbers in Cypher queries Jun 21, 2024
@maffkipp maffkipp marked this pull request as ready for review June 21, 2024 17:20
@maffkipp maffkipp added api A pull request containing changes affecting the API code. bug Something isn't working labels Jun 21, 2024
Copy link
Contributor

@superlinkx superlinkx left a comment

Choose a reason for hiding this comment

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

This looks clean, pull!

@elikmiller
Copy link
Collaborator

I'm looking in the code for something that says if(nextToken === "-") return currentResult * -1; but my small brain cannot comprehend this changeset! 🥲

@maffkipp maffkipp merged commit 095dc36 into main Jul 22, 2024
3 checks passed
@maffkipp maffkipp deleted the BED-4366--parse-negatives-cypher branch July 22, 2024 15:05
@github-actions github-actions bot locked and limited conversation to collaborators Jul 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api A pull request containing changes affecting the API code. bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants