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

Fixes issue decode_responses is set to True regardless if REDIS_OM_UR… #373

Merged
merged 2 commits into from
Sep 8, 2022

Conversation

melder
Copy link
Contributor

@melder melder commented Sep 6, 2022

…L environment variable is set.

Otherwise these warnings pop up when persisting objects:

Could not parse Redis response. Error was: "keywords must be strings". Probably, the connection is not set to decode responses from bytes. Attempting to decode response using the encoding set on model class (<class 'redis_om.model.model.ModelMeta'>. Encoding: utf-8.

To reproduce:

  1. Set "REDIS_OM_URL" environment variable:
    os.environ["REDIS_OM_URL"] = "redis://@localhost:6379"

  2. Copy the model in the example (or whatever you have at hand) and try to do a "get", e.g:

>>> res = o.get('63176e6c-1a8e-40ca-a2ce-d36fcd823009')
Could not parse Redis response. Error was: "keywords must be strings". Probably, the connection is not set to decode responses from bytes. Attempting to decode response using the encoding set on model class (<class 'redis_om.model.model.ModelMeta'>. Encoding: utf-8.

"res" still correctly gets the record data, but the warnings are annoying.

melder and others added 2 commits September 6, 2022 16:22
…L environment variable is set.

Otherwise these warnings pop up when persisting objects:

Could not parse Redis response. Error was: "keywords must be strings". Probably, the connection is not set to decode responses from bytes. Attempting to decode response
using the encoding set on model class (<class 'redis_om.model.model.ModelMeta'>. Encoding: utf-8.
@codecov-commenter
Copy link

codecov-commenter commented Sep 8, 2022

Codecov Report

Merging #373 (db1f166) into main (788d3df) will increase coverage by 0.17%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #373      +/-   ##
==========================================
+ Coverage   77.64%   77.81%   +0.17%     
==========================================
  Files          14       14              
  Lines        1154     1154              
==========================================
+ Hits          896      898       +2     
+ Misses        258      256       -2     
Flag Coverage Δ
unit 77.81% <100.00%> (+0.17%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
aredis_om/connections.py 90.00% <100.00%> (+20.00%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@dvora-h dvora-h merged commit 8325e6e into redis:main Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants