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

Date filters #240

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Date filters #240

wants to merge 4 commits into from

Conversation

prasmussen15
Copy link
Collaborator

@prasmussen15 prasmussen15 commented Dec 11, 2024

Important

Adds date filtering to search operations using a new SearchFilters class, integrated into search functions across the codebase.

  • Behavior:
    • Introduces SearchFilters class in search_filters.py for date-based filtering.
    • Updates search() and _search() in graphiti.py to accept filter parameter of type SearchFilters.
    • Modifies search() in search.py to include filter parameter in search operations.
  • Search Functions:
    • Updates edge_fulltext_search(), edge_similarity_search(), and edge_bfs_search() in search_utils.py to apply date filters using search_filter_query_constructor().
    • Adds filter parameter to edge_search() in search.py to incorporate date filtering.
  • Misc:
    • Removes trailing whitespace in client.py.

This description was created by Ellipsis for ed4ccc8. It will automatically update as commits are pushed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Reviewed everything up to f87c709 in 2 minutes and 15 seconds

More details
  • Looked at 396 lines of code in 5 files
  • Skipped 1 files when reviewing.
  • Skipped posting 9 drafted comments based on config settings.
1. graphiti_core/search/search_filters.py:42
  • Draft comment:
    Ensure that the filter_query string starts with a space or is empty to avoid leading 'AND' in the query. Consider initializing filter_query with a space or handling the first condition separately.
  • Reason this comment was not posted:
    Confidence changes required: 80%
    The search_filter_query_constructor function in search_filters.py constructs a query string by appending conditions with 'AND'. This can lead to a malformed query if the first condition is added without a preceding space or if no conditions are added at all, resulting in a leading 'AND'.
2. graphiti_core/search/search_utils.py:150
  • Draft comment:
    Include filter_query in the cypher_query to ensure that the constructed filter conditions are applied to the search results.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
3. graphiti_core/search/search_utils.py:202
  • Draft comment:
    Ensure filter_query is included in the cypher_query to apply the constructed filter conditions to the search results.
  • Reason this comment was not posted:
    Marked as duplicate.
4. graphiti_core/search/search_utils.py:262
  • Draft comment:
    Ensure filter_query is included in the cypher_query to apply the constructed filter conditions to the search results.
  • Reason this comment was not posted:
    Marked as duplicate.
5. graphiti_core/graphiti.py:629
  • Draft comment:
    Avoid using 'filter' as a variable name since it's a reserved keyword in Python. Consider renaming it to something like 'search_filter'.
  • Reason this comment was not posted:
    Confidence changes required: 80%
    The variable name 'filter' is a reserved keyword in Python. It's better to use a different name to avoid any potential conflicts or confusion.
6. graphiti_core/graphiti.py:689
  • Draft comment:
    Avoid using 'filter' as a variable name since it's a reserved keyword in Python. Consider renaming it to something like 'search_filter'.
  • Reason this comment was not posted:
    Confidence changes required: 80%
    The variable name 'filter' is a reserved keyword in Python. It's better to use a different name to avoid any potential conflicts or confusion.
7. graphiti_core/search/search.py:68
  • Draft comment:
    Avoid using 'filter' as a variable name since it's a reserved keyword in Python. Consider renaming it to something like 'search_filter'.
  • Reason this comment was not posted:
    Confidence changes required: 80%
    The variable name 'filter' is a reserved keyword in Python. It's better to use a different name to avoid any potential conflicts or confusion.
8. graphiti_core/search/search.py:139
  • Draft comment:
    Avoid using 'filter' as a variable name since it's a reserved keyword in Python. Consider renaming it to something like 'search_filter'.
  • Reason this comment was not posted:
    Confidence changes required: 80%
    The variable name 'filter' is a reserved keyword in Python. It's better to use a different name to avoid any potential conflicts or confusion.
9. graphiti_core/search/search_utils.py:139
  • Draft comment:
    Avoid using 'filter' as a variable name since it's a reserved keyword in Python. Consider renaming it to something like 'search_filter'.
  • Reason this comment was not posted:
    Confidence changes required: 80%
    The variable name 'filter' is a reserved keyword in Python. It's better to use a different name to avoid any potential conflicts or confusion.

Workflow ID: wflow_oQGvkPFmpVe0gtBC


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

graphiti_core/search/search_filters.py Show resolved Hide resolved
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 4abf90d in 21 seconds

More details
  • Looked at 55 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. graphiti_core/search/search_filters.py:21
  • Draft comment:
    Since Python 3.11, LiteralString is available in the standard typing module. Consider importing it from there instead of typing_extensions.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The import of LiteralString from typing_extensions is unnecessary since Python 3.11 supports LiteralString in the standard typing module.
2. graphiti_core/search/search_filters.py:15
  • Draft comment:
    The search_filter_query_constructor function contains repetitive code for handling date filters. Consider refactoring to reduce repetition and improve maintainability.
  • Reason this comment was not posted:
    Confidence changes required: 80%
    The code in search_filter_query_constructor is repetitive, especially in handling date filters. This violates the DRY principle.

Workflow ID: wflow_odwhPW7AiGvvxOi5


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on ed4ccc8 in 17 seconds

More details
  • Looked at 86 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. graphiti_core/search/search.py:66
  • Draft comment:
    Update the parameter name in the docstring to 'search_filter' for consistency with the code.
    search_filter: SearchFilters,
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The parameter name 'filter' was changed to 'search_filter' in multiple places for clarity. However, in the 'search' function in 'search.py', the parameter name was not updated in the docstring, which could lead to confusion.
2. graphiti_core/graphiti.py:626
  • Draft comment:
    The variable name filter was changed to search_filter for clarity and to avoid using a reserved keyword. This change is consistent and improves code readability. Ensure this change is applied consistently across the codebase.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The variable name 'filter' was changed to 'search_filter' in multiple places for clarity and to avoid using a reserved keyword. This change is consistent and improves code readability.
3. graphiti_core/search/search.py:65
  • Draft comment:
    The variable name filter was changed to search_filter for clarity and to avoid using a reserved keyword. This change is consistent and improves code readability. Ensure this change is applied consistently across the codebase.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The variable name 'filter' was changed to 'search_filter' in multiple places for clarity and to avoid using a reserved keyword. This change is consistent and improves code readability.

Workflow ID: wflow_yaDrItOuXdywWrWV


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

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

Successfully merging this pull request may close these issues.

2 participants