https://kedro.org/ logo
#questions
Title
# questions
h

Higor Carmanini

07/17/2023, 7:26 PM
Hello Kedro people! I wonder if anyone has been able to resolve this annoying issue of VSCode's
pylance
incorrectly inferring that the
pipeline
function (as imported from
kedro.pipeline
is actually a module. It gets in the way of showing the proper documentation for
kedro.pipeline.modular_pipeline.pipeline()
, and I figure could turn some less Kedro-savvy devs away by thinking they're doing it wrong (me a while back 🙃)
n

Nok Lam Chan

07/17/2023, 8:05 PM
https://github.com/kedro-org/kedro/issues/2805 Hey @Higor Carmanini Did you join the training today? Thanks for raising that, I didn’t know this is an issue as I don’t notice this problem before ( I started using kedro 3 years ago).
In principle I believe this is more a Pylance issue than Kedro, but we were discussing related changes for a different reason, so this might be resolved soon.
h

Higor Carmanini

07/17/2023, 8:12 PM
I did not, that's probably just a coincidence 😄 But great to see someone else already pointed that out. That has confused me for a while, only last week I found out that
pipeline
was not a module being called.
n

Nok Lam Chan

07/17/2023, 8:16 PM
I believe this is a relatively new issue(or regression), I wonder if Pycharm has the same problem?
🤔 1
h

Higor Carmanini

07/17/2023, 8:29 PM
I just realized there is also a
pipeline.py
module inside
kedro.pipeline
, so the clash is not that much of a surprise now. Could be the static checker's lookup priority/order, if that makes sense. There's a reference ambiguity when it comes to
kedro.pipeline.pipeline
.
A simple suggestion would be changing the
pipeline
function name to a more descriptive
build_pipeline
or anything like that. As a kicker we'd get a more description function name, but I guess this is not on the table 🙂
n

Nok Lam Chan

07/18/2023, 12:13 PM
I am more convince this is a Pylance issue, can you try upgrade the Pylance version? I test it with another computer today and I don't see any error.
h

Higor Carmanini

07/18/2023, 8:11 PM
It is already the latest version (other than the pre-release) v2023.7.20. And this has been happening consistently for me in VSCode. Can you show me a screenshot of how it shows to you?
The error comes when you use the
pipeline
which it thinks is the
kedro.pipeline.pipeline
module
n

Nok Lam Chan

07/18/2023, 11:34 PM
image.png
I think I see the same thing as you, but somehow it's not highlighted as error. Did you use any settings ?
h

Higor Carmanini

08/02/2023, 10:47 PM
Dang, I always miss notifications from this Slack. No, I don't think I'm using any specific configs to
pylance
:
Copy code
"python.analysis.typeCheckingMode": "basic",
    "python.analysis.autoFormatStrings": true,
    "python.analysis.enablePytestSupport": true,
    // "python.analysis.inlayHints.callArgumentNames": true,
    "python.analysis.inlayHints.functionReturnTypes": true,
    "python.analysis.inlayHints.pytestParameters": true,
    "python.analysis.inlayHints.variableTypes": false,
    "python.analysis.useLibraryCodeForTypes": true,
👍🏼 1
n

Nok Lam Chan

08/02/2023, 11:04 PM
I can reproduce the same behavior in my own laptop. Not sure what’s the best way to fix it without breaking imports
🤔 1
2 Views