-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Enable mypy for langgraph lib #1771
Conversation
self, checkpoint: Optional[C], config: RunnableConfig | ||
) -> Generator[Self, None, None]: ... | ||
|
||
async def afrom_checkpoint( |
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.
removing async?
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 was removed from the actual lib a while ago, but had been left in this protocol in checkpoint lib
def __init__(self, typ: Type[Value], names: set[Value]) -> None: | ||
super().__init__(typ) | ||
self.names = names | ||
self.seen = set() | ||
self.seen: set[str] = set() |
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 type as str
rather than Value
?
@@ -702,11 +714,23 @@ def _get_channels( | |||
if name != "__slots__" | |||
} | |||
return ( | |||
{k: v for k, v in all_keys.items() if not is_managed_value(v)}, | |||
{k: v for k, v in all_keys.items() if isinstance(v, BaseChannel)}, |
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 this change?
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.
Because mypy doesn't know that everything that isn't a managed value is a base channel
tools: Union[ToolExecutor, Sequence[BaseTool], ToolNode], | ||
*, | ||
state_schema: Optional[StateSchemaType] = None, | ||
messages_modifier: Optional[MessagesModifier] = None, | ||
state_modifier: Optional[StateModifier] = None, | ||
checkpointer: Optional[BaseCheckpointSaver] = None, | ||
interrupt_before: Optional[Sequence[str]] = None, | ||
interrupt_after: Optional[Sequence[str]] = None, | ||
interrupt_before: Optional[list[str]] = None, |
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.
ooc - why the change here?
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.
Because the type accepted by compile changed too
@@ -1,10 +1,13 @@ | |||
# type: ignore |
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
Co-authored-by: William FH <13333726+hinthornw@users.noreply.github.com>
No description provided.