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

#658: Add support for INCRBYFLOAT command #689

Merged
merged 9 commits into from
Sep 23, 2024

Conversation

hash-f
Copy link
Contributor

@hash-f hash-f commented Sep 22, 2024

This PR introduces the INCRBYFLOAT command implementation along with corresponding unit and integration tests.

Key changes:

  • Implemented INCRBYFLOAT command to increment the value of a key by a floating-point value. This command handles:
    • Non-existent keys (initializes with the increment value).
    • Existing keys with integer or floating-point values.
    • Edge cases such as non-numeric values and value overflow to infinity.
  • Added comprehensive integration tests to cover various scenarios, including:
    • Incrementing non-existent keys.
    • Handling integer and floating-point values.
    • Incrementing with both positive and negative values.
    • Handling errors for non-numeric or inappropriate values.

Closes: #658

@hash-f
Copy link
Contributor Author

hash-f commented Sep 22, 2024

@AshwinKul28, please review.

@hash-f hash-f force-pushed the feature/incr-by-float branch from 9ce5ca4 to 52e61b4 Compare September 22, 2024 14:34
@hash-f
Copy link
Contributor Author

hash-f commented Sep 23, 2024

@JyotinderSingh @lucifercr07, requesting your review

@JyotinderSingh JyotinderSingh self-requested a review September 23, 2024 11:14
Copy link
Collaborator

@JyotinderSingh JyotinderSingh left a comment

Choose a reason for hiding this comment

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

Thanks for adding support for INCRBYFLOAT, @hash-f. The changes look good and well-tested, appreciate the efforts around keeping the behavior consistent with redis.

Approved.

@JyotinderSingh JyotinderSingh changed the title Add support for INCRBYFLOAT command #658: Add support for INCRBYFLOAT command Sep 23, 2024
@JyotinderSingh JyotinderSingh merged commit 1d20c2e into DiceDB:master Sep 23, 2024
2 checks passed
shardul08 pushed a commit to shardul08/dice that referenced this pull request Sep 23, 2024
Co-authored-by: Jyotinder Singh <jyotindrsingh@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for command INCRBYFLOAT
2 participants