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

Pyright type check breaks with version 2.8.0 #8624

Open
Calcifer777 opened this issue Dec 11, 2024 · 2 comments
Open

Pyright type check breaks with version 2.8.0 #8624

Calcifer777 opened this issue Dec 11, 2024 · 2 comments
Labels
P2 Medium priority, add to the next sprint if no P1 available

Comments

@Calcifer777
Copy link

Describe the bug
The instantiation of a class decorated with the @component decorator fails with a type check error. Also, the type checker does not recognize the parameters.

This seems related to the deprecation fo the is_greedy parameter, as it is the only change between this release and the previous one (2.7.0)

Error message
Argument missing for parameter "cls"

Expected behavior
No type-check error.

To Reproduce
Type-check any pipeline instantiated with the library using Pyright

FAQ Check

System:

  • OS: linux
  • GPU/CPU: cpu
  • Haystack version (commit or version number): 2.8.0
  • DocumentStore: N/A
  • Reader: N/A
  • Retriever: N/A
@kaqmak
Copy link

kaqmak commented Dec 11, 2024

I can confirm this. Pyright complains. Basically all code with a component breaks the type check.
Running

  • pyright=1.1.390
  • python 3.12

@julian-risch julian-risch added P1 High priority, add to the next sprint P2 Medium priority, add to the next sprint if no P1 available and removed P1 High priority, add to the next sprint labels Dec 12, 2024
@lbux
Copy link
Contributor

lbux commented Dec 16, 2024

This is interesting! I was wondering why hovering over a component no longer showed the Docstring information. For example, haystack-ai == 2.8.0:
image

If I downgrade my package to 2.70:
image

I wonder if this is also related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Medium priority, add to the next sprint if no P1 available
Projects
None yet
Development

No branches or pull requests

4 participants