I am getting the following error when enabling `fl...
# ask-ai
s
I am getting the following error when enabling
flyte.Decks
with a
polars.LazyFrame
as an input:
NotImplementedError: Could not find a renderer for <class 'polars.lazyframe.frame.LazyFrame'>
I therefore created a
LazyFrameRenderer
which implements a
to_html
function and annotated the input:
Copy code
class LazyFrameRenderer:

    def to_html(self, df: pl.LazyFrame) -> str:
        assert isinstance(df, pl.LazyFrame)
        return df.explain()

PL_LF_DECK = Annotated[pl.LazyFrame, LazyFrameRenderer()]
But I still get the same error. Does this not work for input parameters?
j
It seems likely that the issue you're encountering is due to the fact that Flyte's deck renderers are typically used for output visualization rather than input parameters. According to Flyte's documentation, decks are used to render task outputs, and the renderers are applied to the data after the task execution. Your custom
LazyFrameRenderer
is correctly implemented with a
to_html
method, but it seems that Flyte does not support using custom renderers for input parameters directly. The error suggests that Flyte is unable to find a renderer for
polars.LazyFrame
because it is not designed to render inputs in this way. Would you like more details on how to use Flyte decks effectively or how to handle
LazyFrame
outputs? Sources: - Flyte's documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.