Open nuhaj opened 1 month ago
The issue you're encountering is due to missing dependencies and the use of deprecated parameters in the Flyte documentation examples. To resolve this, you need to ensure that the required dependencies are included in the ImageSpec
and update the code to use the enable_deck
parameter instead of the deprecated disable_deck
.
Here's an updated version of your code:
import pandas as pd
from flytekitplugins.deck.renderer import FrameProfilingRenderer
from flytekit import task, ImageSpec, Deck
custom_image = ImageSpec(
packages=["pandas", "scikit-learn"],
apt_packages=["git"],
env={"Debug": "True"},
registry="****",
)
@task(enable_deck=True, container_image=custom_image)
def frame_renderer() -> None:
df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4]})
Deck("Frame Renderer", FrameProfilingRenderer().to_html(df=df))
This code includes the necessary dependencies (pandas
and scikit-learn
) in the ImageSpec
and uses the enable_deck
parameter.
Would you like more details on how to set up and run this example?
Sources:
This is an AI-generated response and your feedback is appreciated! Please leave a 👍 if this is helpful and 👎 if it is not.
Mention @runllm to ask follow-up questions. See runllm.com for more!
I opened a few PRs to fix the docs, but I am not able to reproduce the raise JSONDecodeError("Extra data", s, end)
error.
I was able to get decks working only after the following steps
import pandas as pd
from flytekitplugins.deck.renderer import FrameProfilingRenderer
from flytekit import task, ImageSpec
import flytekit
custom_image = ImageSpec(
packages=[ "pandas", "flytekitplugins-deck-standard"],
registry="****",
).force_push()
@task(enable_deck=True
, container_image=custom_image)
def frame_renderer() -> None:
df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4]})
flytekit.Deck("Frame Renderer", FrameProfilingRenderer().to_html(df=df))
# pyflyte --verbose run --remote -p "workspace" basic.py frame_renderer
Describe the bug
I found the online examples here https://docs.flyte.org/en/latest/user_guide/development_lifecycle/decks.html#decks do not work . There is a scikit-learn and pandas dependency not mentioned that need an image_spec.
This page needs to also be updated since it uses the deprecated disable_deck=False
code and error running test flytedeck
and code
Expected behavior
Render a simple flytedeck example similar to https://docs.flyte.org/en/latest/user_guide/development_lifecycle/decks.html#decks
Additional context to reproduce
No response
Screenshots
No response
Are you sure this issue hasn't been raised already?
Have you read the Code of Conduct?