Closed
Conversation
Contributor
There was a problem hiding this comment.
14 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile
|
|
||
| def _wrap_task(self, key: str, task): | ||
| def wrapped(): | ||
| def _wrap_task(self, key: str, task: Any) -> Any: |
Contributor
There was a problem hiding this comment.
logic: The return type Any is too permissive and doesn't match the actual Callable[[], None] return type of this function
|
|
||
| @functools.wraps(func) | ||
| def wrapper(*args, **kwargs): | ||
| def wrapper(*args: Any, **kwargs: Any) -> Any: |
Contributor
There was a problem hiding this comment.
logic: Missing return value in wrapper function when exception occurs. Should return None explicitly.
Comment on lines
+92
to
+116
| [[tool.mypy.overrides]] | ||
| module = [ | ||
| "langchain.*", | ||
| "openai.*", | ||
| "chromadb.*", | ||
| "tiktoken.*", | ||
| "google.*", | ||
| "anthropic.*", | ||
| "cohere.*", | ||
| "dashscope.*", | ||
| "pymongo.*", | ||
| "bson.*", | ||
| "boto3.*", | ||
| "llama_index.*", | ||
| "respx.*", | ||
| "bs4.*", | ||
| "lark.*", | ||
| "huggingface_hub.*", | ||
| "backoff.*", | ||
| "wrapt.*", | ||
| "packaging.*", | ||
| "requests.*", | ||
| "opentelemetry.*" | ||
| ] | ||
| ignore_missing_imports = true |
Contributor
There was a problem hiding this comment.
logic: The mypy overrides list is comprehensive but missing type ignores for newer dependencies like langgraph. Add langgraph to the overrides list.
Suggested change
| [[tool.mypy.overrides]] | |
| module = [ | |
| "langchain.*", | |
| "openai.*", | |
| "chromadb.*", | |
| "tiktoken.*", | |
| "google.*", | |
| "anthropic.*", | |
| "cohere.*", | |
| "dashscope.*", | |
| "pymongo.*", | |
| "bson.*", | |
| "boto3.*", | |
| "llama_index.*", | |
| "respx.*", | |
| "bs4.*", | |
| "lark.*", | |
| "huggingface_hub.*", | |
| "backoff.*", | |
| "wrapt.*", | |
| "packaging.*", | |
| "requests.*", | |
| "opentelemetry.*" | |
| ] | |
| ignore_missing_imports = true | |
| [[tool.mypy.overrides]] | |
| module = [ | |
| "langchain.*", | |
| "openai.*", | |
| "chromadb.*", | |
| "tiktoken.*", | |
| "google.*", | |
| "anthropic.*", | |
| "cohere.*", | |
| "dashscope.*", | |
| "pymongo.*", | |
| "bson.*", | |
| "boto3.*", | |
| "llama_index.*", | |
| "respx.*", | |
| "bs4.*", | |
| "lark.*", | |
| "huggingface_hub.*", | |
| "backoff.*", | |
| "wrapt.*", | |
| "packaging.*", | |
| "requests.*", | |
| "opentelemetry.*", | |
| "langgraph.*" | |
| ] | |
| ignore_missing_imports = true |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Important
Add type annotations to functions across multiple files and integrate
mypyfor type checking.client.py,datasets.py,utils.py,environment.py,error_logging.py,prompt_cache.py,serializer.py,CallbackHandler.py,utils.py,media.py,model.py, andopenai.py.Any,Optional,Dict,List,Callable,Union,Literal, andTuple.mypyas a development dependency inpyproject.toml.mypysettings inpyproject.tomlto enforce strict type checking, includingdisallow_untyped_defs,warn_return_any, andstrict_equality.mypyoverrides for specific modules to ignore missing imports.This description was created by
for 150289e. You can customize this summary. It will automatically update as commits are pushed.
Greptile Summary
Disclaimer: Experimental PR review
Adds comprehensive MyPy static type checking support across the langfuse-python codebase, improving type safety and code maintainability without modifying runtime behavior.
pyproject.tomlwith third-party import overrideserror_logging.py