Add FPHA (floating-point homogeneous array) arg support to JSON.SET#4011
Merged
Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
vladvildanov
requested changes
Apr 1, 2026
vladvildanov
approved these changes
Apr 2, 2026
petyaslavova
added a commit
that referenced
this pull request
May 26, 2026
…4011) * Add FPHA (floating-point homogeneous array) arg support to JSON.SET * Move FPHA data validation into FPHAType enum
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Add FPHA (floating-point homogeneous array) support to JSON.SET
This PR adds support for the
FPHA(Floating-Point Homogeneous Array) argument inJSON.SET, available in Redis 8.8+. The newfphaparameter allows users to specify a floating-point storage type (BF16,FP16,FP32, orFP64) for numeric arrays, enabling memory optimization by forcing Redis to store all floating-point values in an array using a specific precision.The parameter is added to
set(),set_file(), andset_path()methods, with full sync/async parity including all@overloadsignatures and theAsyncJSONclass overrides.A new
FPHAType(str, Enum)is introduced and exported fromredis.commands.jsonfor convenient, type-safe usage (e.g.,fpha=FPHAType.FP32). Plain strings are also accepted and validated client-side — invalid values raise aDataErrorbefore reaching the server. Case-insensitive string input is supported (e.g.,"fp32"is normalized to"FP32").Tests cover all FPHA types, enum usage, case-insensitive input, combination with
NX/XXmodifiers, and client-side validation of invalid types. Server-dependent tests are gated behind@skip_if_server_version_lt("8.7.0"), while client-side validation tests run unconditionally.Note
Medium Risk
Adds a new argument that changes how
JSON.SETcommands are constructed and validated client-side; behavior now depends on server support/version and incorrect handling could affect writes for callers using the new option.Overview
Adds support for RedisJSON’s
FPHAmodifier onJSON.SETvia a new optionalfphaparameter across sync and asyncio JSON clients, includingset(),set_file(), andset_path().Introduces an
FPHATypeenum with case-insensitive string normalization and client-side validation (raisingDataErrorfor invalid values), and appendsFPHA <type>to the executed command when provided. Tests (sync + asyncio) cover valid types, enum usage, NX/XX interactions, case-insensitivity, and invalid-type errors, with server-dependent cases gated byskip_if_server_version_lt.Reviewed by Cursor Bugbot for commit b5effe9. Bugbot is set up for automated code reviews on this repo. Configure here.