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

Aggregation doesn't work if installed by 'pip install redisearch' #42

Open
DeepAndy opened this issue Oct 12, 2019 · 4 comments
Open

Aggregation doesn't work if installed by 'pip install redisearch' #42

DeepAndy opened this issue Oct 12, 2019 · 4 comments

Comments

@DeepAndy
Copy link

Aggregation doesn't work if installed by 'pip install redisearch'

pip install redisearch
import redisearch
aggregate_request = redisearch.aggregation.AggregateRequest()
AttributeError: 'module' object has no attribute 'aggregation'
@DeepAndy
Copy link
Author

Works ok if redisearch-py installed from sources

@laneme
Copy link

laneme commented Nov 18, 2019

I encountered a similar problem where it would work fine but vscode would show aggregation as undefined. So I downloaded the aggregation module from src and imported from there, rather than from installed redisearch by pip3. And it would show no problem.

This thing definitely has some problems deep inside. Did you figure it out what happened in your case?

@cheeseandcereal
Copy link
Contributor

Fixes for aggregation were released in version 0.8.0

check again with this new version in pypi, it's probably resolved now

@rahil-p
Copy link

rahil-p commented Jan 18, 2021

Given the current version (2.0.0), the example code above should still produce an AttributeError.

The redisearch module doesn't expose the aggregation submodule in its __init__.py file, so it's not available as an attribute of the module. Explicitly importing the submodule should fix it.

import redisearch.aggregation
# or `from redisearch import aggregation`

aggregate_request = redisearch.aggregation.AggregateRequest()

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

4 participants