Skip to content

fix: decode Redis cache values as strings - #38

Draft
Kayvan-Zahiri wants to merge 1 commit into
statsig-io:mainfrom
Kayvan-Zahiri:codex/redis-decode-responses
Draft

Kayvan-Zahiri wants to merge 1 commit into
statsig-io:mainfrom
Kayvan-Zahiri:codex/redis-decode-responses

Conversation

@Kayvan-Zahiri

Copy link
Copy Markdown

Summary

Fixes #32: RedisDataStore.get() returned raw bytes from redis-py, so cached JSON could not be consumed as the str values the rest of the SDK expects.

Pass decode_responses=True when constructing the Redis client so GET/SET use UTF-8 strings, matching the IDataStore contract.

Tests

  • Three new unit tests mock the Redis client and verify constructor options plus string round-trips.
  • tests/test_redis_data_store.py: all pass after the change.
  • Broader offline run: 207 tests passed, 4 skipped; one telemetry test failed in the full parallel run but passed in isolation on unchanged main (order/timing sensitivity). No live Redis or hosted Statsig calls.

AI assistance

Patch and tests were written with AI assistance, reviewed locally, and published from a signed commit on my fork.

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.

Provided RedisDataStore does not work since redis.get() returns bytes rather than strings

1 participant