F. Nikita Thomas

09/05/2022, 4:54 PM
Hi All! quick question, previously in prefect version 0.14.17 a flow could be visualized as long as the package
was installed, but with the current version ,<2.3.1> , I'm having difficulties get some basic code to work - Could someone please assist? Thanks!
import requests
from pprint import pprint as pp
from prefect import flow, task, Flow
import pandas as pd
import json

## extract

def get_data():
    r = requests.get("<>")
    return r.json()

def transform(r: dict):
    df = pd.json_normalize(r["results"])

def write_frame(df: pd.DataFrame):

## This is the way to visualize flow before current version

with Flow("ETL") as flow:
    e = get_data()
    t = transform(e)
    l = write_frame(t)

def flow_test():
    e = get_data()
    t = transform(e)
    l = write_frame(t)
flow_test().visualize() # This doesn't work...

Anna Geller

09/05/2022, 9:00 PM
Prefect 2 is an entirely different product, check our docs at and
in short, Prefect 2 doesn't have this kind of pre-run visualization feature as of today and to get a view of that, you could first run it locally with an ephemeral API and a testing profile before running your flows in production