-
Notifications
You must be signed in to change notification settings - Fork 122
fixed a potential bug #337
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
Merged
Merged
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
57a3596
fixed a potential bug
wiseaidev 06d588a
add unit tests
wiseaidev 35696b6
remove unnecessary logic related to six module
wiseaidev 876e99a
remove six from dependencies
wiseaidev 635bab0
pass "ignore" as a kwarg
wiseaidev e7c0dba
get rid of try catch and simplify logic
wiseaidev da5f2f3
rm poetry.lock
wiseaidev 6785c8a
rm poetry.lock
wiseaidev 858d1ba
run black
wiseaidev 2434d6a
fix mypy issue
wiseaidev 87fc1f1
adjust other tests accordingly
wiseaidev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,7 @@ class Order(BaseHashModel): | |
created_on: datetime.datetime | ||
|
||
class Member(BaseHashModel): | ||
id: int = Field(index=True) | ||
first_name: str = Field(index=True) | ||
last_name: str = Field(index=True) | ||
email: str = Field(index=True) | ||
|
@@ -64,6 +65,7 @@ class Meta: | |
@pytest_asyncio.fixture | ||
async def members(m): | ||
member1 = m.Member( | ||
id=0, | ||
first_name="Andrew", | ||
last_name="Brookins", | ||
email="[email protected]", | ||
|
@@ -73,6 +75,7 @@ async def members(m): | |
) | ||
|
||
member2 = m.Member( | ||
id=1, | ||
first_name="Kim", | ||
last_name="Brookins", | ||
email="[email protected]", | ||
|
@@ -82,6 +85,7 @@ async def members(m): | |
) | ||
|
||
member3 = m.Member( | ||
id=2, | ||
first_name="Andrew", | ||
last_name="Smith", | ||
email="[email protected]", | ||
|
@@ -129,6 +133,9 @@ async def test_exact_match_queries(members, m): | |
).all() | ||
assert actual == [member2] | ||
|
||
actual = await m.Member.find(m.Member.id == 0).all() | ||
assert actual == [member1] | ||
|
||
|
||
@py_test_mark_asyncio | ||
async def test_full_text_search_queries(members, m): | ||
|
@@ -611,4 +618,4 @@ class Address(m.BaseHashModel): | |
assert ( | ||
Address.redisearch_schema() | ||
== f"ON HASH PREFIX 1 {key_prefix} SCHEMA pk TAG SEPARATOR | a_string TAG SEPARATOR | a_full_text_string TAG SEPARATOR | a_full_text_string AS a_full_text_string_fts TEXT an_integer NUMERIC SORTABLE a_float NUMERIC" | ||
) | ||
) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Nice catch!