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

type checking failing due to a dependency update #8820

Open
1 task done
lbux opened this issue Feb 5, 2025 · 0 comments
Open
1 task done

type checking failing due to a dependency update #8820

lbux opened this issue Feb 5, 2025 · 0 comments

Comments

@lbux
Copy link
Contributor

lbux commented Feb 5, 2025

Describe the bug
Clone repo, run hatch shell, and then hatch run test:types. See below for output
Error message

Installing collected packages: types-tabulate, types-six, types-simplejson, types-requests, types-PyYAML, types-pycurl, types-Deprecated, types-decorator, types-dateparser
Successfully installed types-Deprecated-1.2.15.20241117 types-PyYAML-6.0.12.20241230 types-dateparser-1.2.0.20240420 types-decorator-5.1.8.20250121 types-pycurl-7.45.4.20241216 types-requests-2.32.0.20241016 types-simplejson-3.19.0.20241221 types-six-1.17.0.20241205 types-tabulate-0.9.0.20241207

haystack/components/generators/hugging_face_api.py:215: error: Argument 1 to "_build_non_streaming_response" of "HuggingFaceAPIGenerator" has incompatible type "TextGenerationOutput | Iterable[TextGenerationStreamOutput]"; expected "TextGenerationOutput"  [arg-type]
haystack/components/generators/hugging_face_api.py:224: error: Incompatible types in assignment (expression has type "TextGenerationStreamOutputToken", variable has type "TextGenerationOutputToken")  [assignment]
haystack/components/generators/chat/hugging_face_local.py:146: error: Incompatible types in assignment (expression has type "str | None", variable has type "Literal['text-generation', 'text2text-generation'] | None")  [assignment]
haystack/components/generators/chat/hugging_face_api.py:260: error: Argument 3 to "_run_non_streaming" of "HuggingFaceAPIChatGenerator" has incompatible type "list[dict[str, Collection[str]]] | None"; expected "list[ChatCompletionInputTool] | None"  [arg-type]
haystack/components/generators/chat/hugging_face_api.py:294: error: Argument 1 to "StreamingChunk" has incompatible type "str | None"; expected "str"  [arg-type]
haystack/components/generators/chat/hugging_face_api.py:299: error: Dict entry 0 has incompatible type "str": "str | None"; expected "str": "str"  [dict-item]
haystack/components/generators/chat/hugging_face_api.py:300: error: Dict entry 1 has incompatible type "str": "str | None"; expected "str": "str"  [dict-item]
haystack/components/generators/chat/hugging_face_api.py:301: error: Dict entry 2 has incompatible type "str": "int"; expected "str": "str"  [dict-item]
haystack/components/generators/chat/hugging_face_api.py:302: error: Dict entry 3 has incompatible type "str": "dict[str, int]"; expected "str": "str"  [dict-item]
haystack/components/generators/chat/hugging_face_api.py:303: error: Dict entry 4 has incompatible type "str": "str | None"; expected "str": "str"  [dict-item]
haystack/components/generators/chat/hugging_face_api.py:347: error: Incompatible types in assignment (expression has type "dict[str, int]", target has type "int | str | None")  [assignment]

Expected behavior
We should either pin whatever dependency is causing this issue or fix the errors.

Additional context
This was working fine before I cleared my UV cache. Now that everything was downloaded fresh, it seems like an update to a package is causing these errors.
To Reproduce
git clone https://github.com/deepset-ai/haystack
hatch shell
hatch run test:types

FAQ Check

System:

  • OS: Ubuntu
  • GPU/CPU: N/A
  • Haystack version (commit or version number): d2348ad
  • DocumentStore: N/A
  • Reader: N/A
  • Retriever: N/A
  • Python Version: 3.11
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

No branches or pull requests

1 participant