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

No module named 'redis.commands' #121

Closed
diman82 opened this issue Feb 6, 2023 · 7 comments
Closed

No module named 'redis.commands' #121

diman82 opened this issue Feb 6, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@diman82
Copy link

diman82 commented Feb 6, 2023

Describe the bug
Using latest version of the package 2.7.1, I get the following error:

`ERROR: tests.test_custom_xcom (nose2.loader.ModuleImportFailure)

ImportError: Failed to import test module: tests.test_custom_xcom
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/nose2/plugins/loader/discovery.py", line 204, in _find_tests_in_file
module = util.module_from_name(module_name)
File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/nose2/util.py", line 76, in module_from_name
import(name)
File "/home/runner/work/data-management-airflow-2/data-management-airflow-2/tests/test_custom_xcom.py", line 7, in
import fakeredis
File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/fakeredis/init.py", line 1, in
from ._server import FakeServer, FakeRedis, FakeStrictRedis, FakeConnection, FakeRedisConnSingleton
File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/fakeredis/_server.py", line 12, in
from fakeredis._fakesocket import FakeSocket
File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/fakeredis/_fakesocket.py", line 1, in
from fakeredis.stack import JSONCommandsMixin
File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/fakeredis/stack/init.py", line 7, in
raise e
File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/fakeredis/stack/init.py", line 3, in
from redis.commands.json.path import Path # noqa: F401
ModuleNotFoundError: No module named 'redis.commands'`

To Reproduce
Steps to reproduce the behavior:

  1. import fakeredis module

Expected behavior
sub-dependency module is correctly imported

Desktop (please complete the following information):

  • OS: WSL (Ubuntu)
  • python version: 3.8.10
  • redis-py version: 2.7.1

Additional context
having latest apache-airflow-providers-redis package, which installs redis==3.5.3

@diman82 diman82 added the bug Something isn't working label Feb 6, 2023
@cunla
Copy link
Owner

cunla commented Feb 6, 2023

Are you using json module?

@cunla
Copy link
Owner

cunla commented Feb 6, 2023

Hi, In version 2.0.0 support for redis-py < 4 was removed.

However, you are using redis-py version: 2.7.1 while the apache-airflow-providers-redis package requires redis-py ~3.2.

I can update fakeredis so you won't get this exception, but you won't be able to use JSON commands.

@diman82
Copy link
Author

diman82 commented Feb 7, 2023

@cunla Yes, please update fakeredis library, IMHO the best would be to convert this exception to warning

@cunla
Copy link
Owner

cunla commented Feb 7, 2023

Fixed, will be in next version

@cunla cunla closed this as completed Feb 7, 2023
@diman82
Copy link
Author

diman82 commented Feb 8, 2023

@cunla When approximately should we expect the new version?

@hyeongguen-song
Copy link
Contributor

@diman82 , cunla just released a new version

@diman82
Copy link
Author

diman82 commented Feb 12, 2023

@cunla @hyeongguen-song Confriming issue has been resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants