kedro-org / kedro-viz

Visualise your Kedro data and machine-learning pipelines and track your experiments.
https://demo.kedro.org
Apache License 2.0
647 stars 106 forks source link

Pin `pydantic>=2.0.0` #1842

Closed inigohidalgo closed 2 months ago

inigohidalgo commented 3 months ago

Description

kedro-viz 8.0.0 migrated to pydantic v2, without keeping backwards-compatibility. This requirement is not listed in kedro-viz's dependencies, pydantic is only being installed as a transitive dependency of fastapi, which is pinned to >=0.100, but 0.100 is compatible with pydantic v1

Additional info

Versions

python==3.10.13
kedro==0.18.14
kedro-viz==8.0.1
pydantic==1.10.14
fastapi==0.110.1

Traceback

[04/02/24 10:01:57] WARNING  Failed to load kedro_viz.launchers.cli commands from                           utils.py:363
                             EntryPoint(name='kedro-viz', value='kedro_viz.launchers.cli:viz_cli',
                             group='kedro.global_commands'). Full exception: cannot import name
                             'ValidationInfo' from 'pydantic'
astrojuanlu commented 3 months ago

I checked all utils.py files in kedro-viz and didn't see where this import is coming from 😅

@rashidakanchwala @ravi-kumar-pilla is there a way to turn this into a full traceback?

[04/02/24 10:01:57] WARNING  Failed to load kedro_viz.launchers.cli commands from                           utils.py:363
                             EntryPoint(name='kedro-viz', value='kedro_viz.launchers.cli:viz_cli',
                             group='kedro.global_commands'). Full exception: cannot import name
                             'ValidationInfo' from 'pydantic'

I see that kedro viz run doesn't have a --verbose flag of sorts. Should we open a different issue about this?

ravi-kumar-pilla commented 3 months ago

I checked all utils.py files in kedro-viz and didn't see where this import is coming from 😅

@rashidakanchwala @ravi-kumar-pilla is there a way to turn this into a full traceback?

[04/02/24 10:01:57] WARNING  Failed to load kedro_viz.launchers.cli commands from                           utils.py:363
                             EntryPoint(name='kedro-viz', value='kedro_viz.launchers.cli:viz_cli',
                             group='kedro.global_commands'). Full exception: cannot import name
                             'ValidationInfo' from 'pydantic'

I see that kedro viz run doesn't have a --verbose flag of sorts. Should we open a different issue about this?

@astrojuanlu - We have the import in models -> flowchart.py . So the error is triggered due to import error

The --verbose option was previously asked by another user as well. I think Kedro supports this option and we can create a ticket to add support in viz too

astrojuanlu commented 3 months ago

Okay, here it is

https://github.com/kedro-org/kedro-viz/blob/2a6cff73b3ab19f74dc90b979255b212d669b389/package/kedro_viz/models/flowchart.py#L15-L19

This is another instance of #1821

The --verbose option was previously asked by another user as well. I think Kedro supports this option and we can create a ticket to add support in viz too

In fact we're discussing about adding it, but it would mean a slightly different thing. Let's keep @iamelijahko in the loop before going ahead.