-
Notifications
You must be signed in to change notification settings - Fork 41
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
Improve RedisVL filter handling, docs, and examples #72
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #72 +/- ##
==========================================
+ Coverage 87.43% 87.51% +0.08%
==========================================
Files 17 17
Lines 899 937 +38
==========================================
+ Hits 786 820 +34
- Misses 113 117 +4
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm approving, however, I think we should leave out the index updating (or maybe move somewhere other than getting started). I think it makes things seem more complicated and I think we want that to be the lowest bar to cross possible.
Other than that, I pushed up a few changes. Biggest thing is the change of _set_value
. Essentially, I don't think it's necessary to treat anything except for tag differently. I've made a few tests for this as well and updated the hybrid query notebook.
# TODO - enable async version of this | ||
# check_redis_modules_exist(self._redis_conn) | ||
|
||
if not self._fields: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be allowed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the current behavior of the synchro version of the create
method, and was just missing here
@@ -499,6 +508,7 @@ def connect(self, url: Optional[str] = None, **kwargs): | |||
ValueError: If no Redis URL is provided and REDIS_URL env var is not set. | |||
""" | |||
self._redis_conn = get_async_redis_connection(url, **kwargs) | |||
return self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above
@@ -317,6 +318,7 @@ def connect(self, url: Optional[str] = None, **kwargs): | |||
ValueError: If the REDIS_URL env var is not set and url is not provided. | |||
""" | |||
self._redis_conn = get_redis_connection(url, **kwargs) | |||
return self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this feels odd given that then... it's a classmethod ... kindaof
Is this to make things more fluent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it reduces the potential lines of code for a user by allowing index = SearchIndex.from_dict(...).connect(...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Addresses #71 which highlights the need to support more edge case queries like "empty queries" or more sophisticated text LIKE query patterns.
overwrite=False
case.