Hi all! Flyte rookie here, maybe you can help me o...
# flyte-support
t
Hi all! Flyte rookie here, maybe you can help me out :) I'm trying to render a NotebookTask into a Flyte Deck. This is the task configuration inside the .py file (taken almost verbatim):
Copy code
nb = NotebookTask(
    name="simple-nb",
    notebook_path=os.path.join(NOTEBOOK_PATH, "text.ipynb"),
    render_deck=True,
    inputs=kwtypes(s=str),
    outputs=kwtypes(text=str)
)
However, there is no "Flyte Deck" button on the output view, even though the task completes successfully. Flyte Deck does show up for simpler tasks such as these:
Copy code
@task(disable_deck=False)
def t1() -> str:
    md_text = "#Hello Flyte\n##Hello Flyte\n###Hello Flyte"
    flytekit.Deck("demo", BoxRenderer("sepal_length").to_html(iris_df))
    flytekit.current_context().default_deck.append(MarkdownRenderer().to_html(md_text))
    return md_text
For context, this is running locally on the sandbox "cluster".
t
Copy code
from flytekit.types.file import HTMLPage, PythonNotebook

nb = NotebookTask(
    name=notebook_name,
    notebook_path=notebook_path,
    render_deck=True,
    disable_deck=False,
    outputs=kwtypes(out_nb=PythonNotebook, out_rendered_nb=HTMLPage),
)
Something like this worked for me. Remember having this issue. Maybe youโ€™re missing the
disable_deck=False
?
t
Thanks @thankful-tailor-28399 I will try this out. I did add disable_deck=False before which didn't help, but I will try the new outputs.
OK, just tried it out and it worked ๐Ÿ™‚
Copy code
nb = NotebookTask(
    name="simple-nb",
    notebook_path=os.path.join(NOTEBOOK_PATH, "text.ipynb"),
    render_deck=True,
    disable_deck=False,
    inputs=kwtypes(s=str),
    outputs=kwtypes(text=str, out_rendered_nb=HTMLPage)
)
Thanks again @thankful-tailor-28399!
t
Glad it worked ๐Ÿ’ช
f
Ya the disable-deck is sad, we had to do it to ensure backwards compatibility
t
Maybe worth defaulting it to False for the NotebookTask_
t
@freezing-airport-6809 It would really help if at least the docs get updated with both that flag and the explicit output, because the example shown doesn't work ๐Ÿ™‚ https://docs.flyte.org/projects/cookbook/en/stable/auto_examples/papermill_plugin/simple.html
f
Render-deck should work - cc @tall-lock-23197 can you please TAL
t
I'll take a look and update the example in the docs accordingly.
๐Ÿ™‡ 1