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

Pylance/VSCode says "Expected 1 more positional argument" when using pipe operator #418

Open
norabelrose opened this issue Apr 28, 2022 · 2 comments

Comments

@norabelrose
Copy link

Hi, thanks for the great library. I've noticed that when I'm using an iPython notebook in VSCode with type checking turned on, Pylance doesn't recognize the verb functions as being able to take zero positional arguments when combined with the pipe operator.
Screen Shot 2022-04-28 at 11 42 27 AM

I think this should be able to be resolved using typing.overload or something similar. I was wondering if this is on your radar of problems to fix. I might have the time to contribute a PR for this if need be (no promises though).

@machow
Copy link
Owner

machow commented Apr 28, 2022

Hey--thanks for raising! If you want to take a stab at it, I think a quick typing overload to this function should fix it...

https://github.com/machow/siuba/blob/main/siuba/siu/dispatchers.py#L124

It seems like one overload for the no argument case, and one similar to this pyright overload (except that for now I think the return type will need to be any? down the road could add a Frame abstract base class or something...?)

(Otherwise, I want to switch to using more vs code + pyright, so can hopefully fix in the next couple weeks!)

@norabelrose
Copy link
Author

@machow Thanks for the quick response. I'll look at it tonight and see if it's a quick fix.

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

2 participants