-
Notifications
You must be signed in to change notification settings - Fork 75
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
chore: Fix Typing Issues #27
Conversation
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.
👍 Looks good to me! Reviewed everything up to d4d73b1 in 50 seconds
More details
- Looked at
426
lines of code in15
files - Skipped
0
files when reviewing. - Skipped posting
8
drafted comments based on config settings.
1. core/graphiti.py:84
- Draft comment:
Usetyping.Any
instead ofany
for type annotations. This change is already applied in other parts of the codebase. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment is redundant because the change it suggests has already been made in the code. It does not provide any new information or require further action from the author.
I might be overlooking the possibility that the comment is meant to confirm the change was correctly applied, but the rules specify not to make purely informative comments.
Even if the comment is meant to confirm the change, it is not necessary as the change is already visible in the diff.
The comment should be removed because it is redundant and does not require any further action.
2. core/llm_client/client.py:14
- Draft comment:
Usetyping.Any
instead ofany
for type annotations. This change is already applied in other parts of the codebase. - Reason this comment was not posted:
Marked as duplicate.
3. core/llm_client/openai_client.py:19
- Draft comment:
Usetyping.Any
instead ofany
for type annotations. This change is already applied in other parts of the codebase. - Reason this comment was not posted:
Marked as duplicate.
4. core/nodes.py:38
- Draft comment:
Usetyping.Any
instead ofany
for type annotations. This change is already applied in other parts of the codebase. - Reason this comment was not posted:
Marked as duplicate.
5. core/prompts/dedupe_edges.py:18
- Draft comment:
Usetyping.Any
instead ofany
for type annotations. This change is already applied in other parts of the codebase. - Reason this comment was not posted:
Marked as duplicate.
6. core/prompts/dedupe_nodes.py:19
- Draft comment:
Usetyping.Any
instead ofany
for type annotations. This change is already applied in other parts of the codebase. - Reason this comment was not posted:
Marked as duplicate.
7. core/prompts/extract_edges.py:17
- Draft comment:
Usetyping.Any
instead ofany
for type annotations. This change is already applied in other parts of the codebase. - Reason this comment was not posted:
Marked as duplicate.
8. core/prompts/extract_nodes.py:19
- Draft comment:
Usetyping.Any
instead ofany
for type annotations. This change is already applied in other parts of the codebase. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_KOHzzHWvRQQfe5Bi
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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.
👍 Looks good to me! Incremental review on a7e5a88 in 46 seconds
More details
- Looked at
719
lines of code in16
files - Skipped
0
files when reviewing. - Skipped posting
6
drafted comments based on config settings.
1. core/graphiti.py:74
- Draft comment:
Thesources
parameter in theretrieve_episodes
method is removed, but this change is not mentioned in the PR description. Ensure this change is intentional and update the PR description if necessary. - Reason this comment was not posted:
Confidence changes required:50%
The PR description mentions replacingany
withtyping.Any
for type annotations. However, incore/graphiti.py
, thesources
parameter in theretrieve_episodes
method is removed, which is not mentioned in the PR description. This change might be unintentional or undocumented.
2. core/llm_client/client.py:14
- Draft comment:
Theget_embedder
method returnstyping.Any
. Consider using a more specific type for better type safety. - Reason this comment was not posted:
Confidence changes required:50%
Theget_embedder
method inLLMClient
andOpenAIClient
returnstyping.Any
. This is not ideal for type safety. Consider using a more specific type if possible.
3. core/llm_client/openai_client.py:23
- Draft comment:
Thegenerate_response
method returnsdict[str, typing.Any]
. Consider using a more specific type for better type safety. - Reason this comment was not posted:
Confidence changes required:50%
Inopenai_client.py
, thegenerate_response
method usestyping.Any
for the return type. This could be more specific for better type safety.
4. core/prompts/lib.py:84
- Draft comment:
ThePromptLibraryWrapper
class uses# type: ignore[arg-type]
. Consider ensuring type correctness to avoid suppressing type errors. - Reason this comment was not posted:
Confidence changes required:50%
Incore/prompts/lib.py
, thePromptLibraryWrapper
class uses# type: ignore[arg-type]
to suppress type errors. This should be avoided if possible by ensuring type correctness.
5. core/search/search.py:32
- Draft comment:
Theembedder
parameter usestyping.Any
. Consider using a more specific type for better type safety. - Reason this comment was not posted:
Confidence changes required:50%
Incore/search/search.py
, thehybrid_search
function usestyping.Any
for theembedder
parameter. Consider using a more specific type for better type safety.
6. core/utils/bulk_utils.py:191
- Draft comment:
Theresolve_edge_pointers
function does not return a value, but it is used as if it does. Consider returning the modified list explicitly. - Reason this comment was not posted:
Confidence changes required:50%
Incore/utils/bulk_utils.py
, theresolve_edge_pointers
function does not return a value, but it is used as if it does. This could lead to confusion.
Workflow ID: wflow_hAY2DlmmNIN7CeSp
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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.
👍 Looks good to me! Incremental review on f9ac342 in 40 seconds
More details
- Looked at
392
lines of code in9
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. core/utils/maintenance/__init__.py:1
- Draft comment:
AddEntityEdge
to the imports to ensureinvalidate_edges
works correctly. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment seems speculative as it suggests adding an import without any evidence from the diff that 'EntityEdge' is needed. The diff does not show any changes related to 'EntityEdge' or 'invalidate_edges' that would necessitate this import.
I might be missing context from other parts of the codebase where 'EntityEdge' is indeed required for 'invalidate_edges'. However, based on the diff alone, there is no indication of this requirement.
The task is to review the diff provided, and based on this diff, there is no evidence that 'EntityEdge' is needed. Therefore, the comment seems unnecessary.
The comment should be removed as it suggests a change that is not supported by the diff provided.
Workflow ID: wflow_tOquQCmLXJfZbeyh
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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.
👍 Looks good to me! Incremental review on 129eefd in 17 seconds
More details
- Looked at
80
lines of code in4
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. core/utils/maintenance/edge_operations.py:4
- Draft comment:
Any
is used in this file but not imported. Consider importingAny
fromtyping
. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment is incorrect becauseAny
is not used in the file, and the import was removed for that reason. The comment does not suggest a necessary code change.
I might be missing some context about the usage ofAny
elsewhere, but based on the provided code, it seems clear thatAny
is not needed.
The code provided does not show any usage ofAny
, so the comment is not applicable.
The comment should be removed because it suggests an unnecessary import ofAny
.
Workflow ID: wflow_yYE8GFSa9bpaNsOY
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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.
👍 Looks good to me! Incremental review on 67dc5c6 in 17 seconds
More details
- Looked at
25
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. core/search/search.py:10
- Draft comment:
Reordering imports without a specific reason can reduce readability. Consider keeping imports in alphabetical order for consistency. - Reason this comment was not posted:
Confidence changes required:33%
The import statement forEpisodicNode
andEntityNode
was reordered, but this change is not necessary and does not improve the code. It is better to keep the imports in alphabetical order for consistency.
Workflow ID: wflow_8J0UQ5qNtd2Z1FpF
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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.
👍 Looks good to me! Incremental review on ac18d4c in 36 seconds
More details
- Looked at
93
lines of code in4
files - Skipped
0
files when reviewing. - Skipped posting
5
drafted comments based on config settings.
1. core/nodes.py:38
- Draft comment:
Changingvalid_at
fromdatetime | None
todatetime
removes the possibility ofNone
. Ensure this aligns with the intended logic, as it may cause issues ifNone
is a valid state. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment highlights a change that could affect the logic of the application if 'None' was previously a valid state for 'valid_at'. This is a valid concern as it could lead to runtime errors if the code expects 'valid_at' to sometimes be 'None'.
The comment could be seen as speculative since it assumes that 'None' might have been a valid state without confirming it. However, it is a valid point to consider when changing a field's type.
While the comment could be seen as speculative, it is important to consider the implications of changing a field's type, especially if it could lead to runtime errors.
Keep the comment as it highlights a potential issue with the change in the field's type that could affect the logic of the application.
2. core/search/search_utils.py:45
- Draft comment:
Ensurerecord['created_at']
is always aneo4j_time.DateTime
object. If it can beNone
, usesafely_parse_db_date
for safety. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment is speculative and asks for verification, which is against the rules. The code assumesrecord['created_at']
is aneo4j_time.DateTime
object, and the change aligns with this assumption. The comment does not point out a definite issue but rather suggests a precautionary measure, which is not actionable or necessary given the context.
I might be overlooking a scenario whererecord['created_at']
could indeed beNone
, but the code change does not introduce this possibility. The comment does not address a definite issue in the code.
The code change does not introduce a scenario whererecord['created_at']
could beNone
, and the comment does not address a definite issue. It is speculative and not actionable.
Remove the comment as it is speculative and not actionable, and the code change does not introduce a definite issue.
3. core/search/search_utils.py:174
- Draft comment:
Ensurerecord['created_at']
is always aneo4j_time.DateTime
object. If it can beNone
, usesafely_parse_db_date
for safety. - Reason this comment was not posted:
Marked as duplicate.
4. core/search/search_utils.py:209
- Draft comment:
Ensurerecord['created_at']
is always aneo4j_time.DateTime
object. If it can beNone
, usesafely_parse_db_date
for safety. - Reason this comment was not posted:
Marked as duplicate.
5. core/utils/bulk_utils.py:43
- Draft comment:
Ensureepisode.valid_at
is always set. If it can beNone
, this change might cause issues. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment is speculative and asks the author to ensure a condition, which is against the rules. It does not point out a definite issue but rather suggests a potential one. The rules clearly state not to make speculative comments or ask the author to ensure something.
The comment might be pointing out a potential issue that could cause a bug ifepisode.valid_at
isNone
. However, the rules are clear about not making speculative comments.
Even if the comment points out a potential issue, it is speculative and asks the author to ensure something, which is against the rules.
The comment should be removed as it is speculative and asks the author to ensure a condition, which violates the rules.
Workflow ID: wflow_oNdXLY6pHrQb73E8
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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.
👍 Looks good to me! Incremental review on c6e7938 in 20 seconds
More details
- Looked at
13
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. core/utils/search/search_utils.py:105
- Draft comment:
Consider usingsafely_parse_db_date
forcreated_at
to ensure consistent date parsing and handle potential parsing issues. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment is suggesting a change that the author has already considered and decided against. The author likely has a reason for not usingsafely_parse_db_date
forcreated_at
, such as the data already being in the correct format. The comment does not provide new information or a clear reason why the change is necessary.
I might be missing the context of why the author made the change. There could be a valid reason for not usingsafely_parse_db_date
, such as performance considerations or data format guarantees.
The author likely has a reason for their change, and the comment does not provide a compelling reason to revert it. Without additional context, the comment seems unnecessary.
The comment should be removed as it suggests a change that the author has already considered and decided against, without providing a compelling reason for the change.
Workflow ID: wflow_nNAQGm79o0FuyLHY
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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.
❌ Changes requested. Incremental review on 089a7ec in 20 seconds
More details
- Looked at
342
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_xCE1scHmaQh7XA2i
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.
@@ -35,7 +34,7 @@ async def extract_new_edges( | |||
llm_client: LLMClient, |
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.
We should actually just remove this function instead, I deprecated wit the architecture change of splitting two prompts
Summary:
This PR refines type annotations and imports across multiple files for improved clarity and consistency.
Key points:
Message
model incore/llm_client/client.py
andcore/llm_client/openai_client.py
.generate_response
method to uselist[Message]
.any
withtyping.Any
in type annotations.EntityEdge
incore/search/search.py
.SearchResults
class to uselist[EpisodicNode]
,list[EntityNode]
,list[EntityEdge]
.core/utils/__init__.py
.Any
incore/utils/maintenance/edge_operations.py
.core/utils/maintenance/node_operations.py
.core/graphiti.py
,core/nodes.py
,core/prompts
,core/utils/maintenance
.Generated with ❤️ by ellipsis.dev