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

Export float conversion routines (or convert exported data into go types) #3206

Open
nikolaydubina opened this issue Dec 11, 2024 · 0 comments

Comments

@nikolaydubina
Copy link

nikolaydubina commented Dec 11, 2024

very important value __score in FT.SEARCH is returned as raw string not converted. users need manually convert it to float

now, this is internal redis type.

and redis go pkg does not export functions to convert it. which is bad and error prone and leads to wrong re-implementations.

Expected Behavior

Either:

  • A) provide utilities to convert internal string float representations
  • B) export standard float notation (and rest of types)
  • C) export normal native go float in exposed functions

Current Behavior

image image

Possible Solution

export this https://github.com/redis/go-redis/blob/master/internal/proto/reader.go#L192

Steps to Reproduce

  1. use FT.SEARCH __score field in Go
  2. try to convert it to float
  3. search for any methods that redis provides to convert it (there is none)

Context (Environment)

FT.SEARCH is very important. __score is very important.

and this is not even proper float... what....

INFO

# Server
redis_version:7.2.6
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:afdd7ad38aac5fcf
redis_mode:standalone
os:Linux 6.1.112+ x86_64
arch_bits:64
monotonic_clock:POSIX clock_gettime
multiplexing_api:epoll
atomicvar_api:c11-builtin
gcc_version:11.4.0
process_id:8

go version go1.23.0 darwin/arm64

go.mod

github.com/redis/go-redis/v9 v9.7.0

Detailed Description

Possible Implementation

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

No branches or pull requests

1 participant