PrefectHQ / prefect

Prefect is a workflow orchestration framework for building resilient data pipelines in Python.
https://prefect.io
Apache License 2.0
15.82k stars 1.55k forks source link

not a known member of module "prefect.runtime" #9027

Open tekumara opened 1 year ago

tekumara commented 1 year ago

First check

Bug summary

The prefect.runtime API has not been exported, and so errors in vscode/pyright with:

error: "task_run" is not a known member of module "prefect.runtime"

CleanShot 2023-04-01 at 13 20 43@2x

Reproduction

from prefect import flow, task
import prefect.runtime

@flow(log_prints=True)
def my_flow(x):
    print("my name is", prefect.runtime.flow_run.name)
    print("i belong to deployment", prefect.runtime.deployment.name)
    my_task(2)

@task
def my_task(y):
    print("my name is", prefect.runtime.task_run.name)
    print("flow run got parameters", prefect.runtime.flow_run.parameters)

my_flow(1)

Error

error: "flow_run" is not a known member of module "prefect.runtime"

Versions

prefect 2.9.0

Additional context

This also means there's no autocomplete for functions in the prefect.runtime module.

luluagasantiago commented 9 months ago

Is this issue still up?

tekumara commented 9 months ago

yes this is still an issue as of 2.14.9