Hi there. I recently started getting some errors on VS Code using pylance.
For example, the following line
Copy code
from prefect import Flow, Parameter, task, unmapped
produces
Copy code
"Flow" is not exported from module "prefect"
Import from "prefect.core" instead Pylance(reportPrivateImportUsage)
"Parameter" is not exported from module "prefect"
Import from "prefect.core" instead Pylance(reportPrivateImportUsage)
"task" is not exported from module "prefect"
Import from "prefect.utilities.tasks" instead Pylance(reportPrivateImportUsage)
is not exported from module "prefect"
Import from "prefect.utilities.edges" instead Pylance(reportPrivateImportUsage)
Also, I am getting pylance errors when passing Parameters to tasks that expect
str
arguments. I don't believe this was happening before.
Do you know if something changed recently in pylance or in how we are supposed to import modules? I am using prefect 0.15.4 Thanks!
k
Kevin Kho
09/17/2021, 1:51 PM
Hey @Pedro Machado, I don’t use Pylance but nothing changed with the imports and you’re using them right.
Kevin Kho
09/17/2021, 2:04 PM
What is your Pylance version? Will try to look into it
p
Pedro Machado
09/17/2021, 2:07 PM
The extension version is v2021.9.2
Pedro Machado
09/17/2021, 2:10 PM
There are some items in the changelog related to an upgrade of
Pyright
that sound like could be causing this but I can't tell for sure.
k
Kevin Kho
09/17/2021, 2:14 PM
Stupid question. Turns out I do have Pylance 2021.5.2. Why do I not see later versions?
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.