It seems that `kedro-viz` does not recognise `kedr...
# plugins-integrations
y
It seems that
kedro-viz
does not recognise
kedro-mlflow
matplotlib plots: while it does appear as a data node in the
kedro-viz
dashboard, the content cannot be examined as a usual matplotlib png.
Copy code
example_plot:
  type: kedro_mlflow.io.artifacts.MlflowArtifactDataSet
  data_set:
    type: matplotlib.MatplotlibWriter
    filepath: data/08_reporting/example_plot.png
    versioned: true
đź‘€ 2
n
@Nero Okwa
n
It seems correct as per the docs. Can you remove 'versioned: true' and try it again.
@Yolan Honoré-Rougé any thoughts on this?
d
@Nero Okwa would you expect support for
MlflowArtifactDataSet
. I've never tried this, but intuitively I wouldn't expect Kedro-Viz to support a dataset using
MatplotlibWriter
under the hood.
n
@Deepyaman Datta Yes Kedro Viz supports this, but you need add it to your dependencies first.
@Yong Bang Xiang have you added the dataset to your
src/requirements.txt
file? like this:
Copy code
kedro-datasets[matplotlib.MatplotlibWriter]~=1.1
seaborn~=0.12.1
y
yes i have. still no luck.
n
Can you share a screenshot of what you are seeing?
y
Copy code
example_plot:
  type: matplotlib.MatplotlibWriter
  filepath: data/08_reporting/example_plot.png
Copy code
example_plot:
  type: kedro_mlflow.io.artifacts.MlflowArtifactDataSet
  data_set:
    type: matplotlib.MatplotlibWriter
    filepath: data/08_reporting/example_plot.png
y
How does kedro-viz decide what to plot? Does it check for the dataset being a ``MatplotlibWriter`` instance?
n
Yes.
y
If yes, it explains the issue because kedro-mlflow turns it into a ``MlflowMatplotlibWriter`` object under the hood
n
Agree with @Deepyaman Datta, I don’t expect kedro-viz work for custom dataset as it is inspecting the type of dataset directly. @Yolan Honoré-Rougé Does ``Mlflow.MatplotlibWriter` exist? I did a quick search and couldn’t find anything related.
I think it is more beneficial to turn this into a discussion how we can have a generic support. Same goes with the
DataFrame
preview feature. Questions: 1. Do we want to add support for individual datasets when requested? 2. Or can we provide a way that allow user to register their own dataset to be displayed?
👍🏽 1
y
No, actually MlflowArtifactDataSet is a very special dataset which use ___new___ toninstantiate class and fake inheritance. It modifies object class on the fly.
đź‘€ 1
n
Obviously not everything can be supported, so we need to consider what can be display. For
preview
feature, it is less restricted because we inspect
DataFrame
instead of
pandas.CSVDataSet
, meaning that if user implement their own
pandas.MyDataSet
it will still work as long as it returns a DataFrame.
d
I think, rather than adding support for individual datasets, it may make sense to create an interface that datasets can implement to have this support, because its a relativrly small set of datasets that would need to support it (I'd assume). That said, this is definitely a topic that would require tech design. :) But @Yong Bang Xiang to close the loop: I would say it's the expected behavior that this doesn't currently work, however unfortunate
👍🏼 1
đź‘Ť 1
👍🏽 1
j
I think, rather than adding support for individual datasets, it may make sense to create an interface that datasets can implement to have this support
+100, maybe even checking for
_repr_png_
method, like IPython/Jupyter do
đź‘Ť 2