Fazil Topal
09/30/2024, 2:14 PMdatajoely
09/30/2024, 2:18 PMFazil Topal
09/30/2024, 2:21 PMRashida Kanchwala
09/30/2024, 2:27 PMFazil Topal
09/30/2024, 2:28 PMRashida Kanchwala
09/30/2024, 2:29 PMNok Lam Chan
09/30/2024, 2:30 PMNok Lam Chan
09/30/2024, 2:31 PMFazil Topal
09/30/2024, 2:31 PMdatajoely
09/30/2024, 2:32 PMdatajoely
09/30/2024, 2:33 PMkedro-viz --lite
which was just shipped and builds the DAG through ast introspection without actually executing it , because you can now run kedro-viz without any of the actual dependencies (other than Kedro) installedFazil Topal
09/30/2024, 2:34 PMJuan Luis
09/30/2024, 3:31 PMuvx --with kedro-viz kedro viz run --lite
should work in any project. I just tested it.datajoely
09/30/2024, 3:32 PMdatajoely
09/30/2024, 3:32 PMJuan Luis
09/30/2024, 4:13 PM$ cat Dockerfile
FROM python:3.9-slim
RUN pip install uv && uv pip install --system kedro-viz kedro
EXPOSE 4141
WORKDIR /app
ENTRYPOINT ["kedro", "viz", "run", "--lite", "--host", "0.0.0.0"]
$ docker build -t kedro-viz-lite .
...
$ docker run -p 4141:4141 -v ~/Projects/demo:/app kedro-viz-lite
this works just fine šFazil Topal
10/01/2024, 2:14 PMFile "/app/src/projx/models/text/base.py", line 34, in <module>
class AnthropicAssistant(BaseMessage):
File "/opt/conda/envs/py/lib/python3.10/dataclasses.py", line 1184, in dataclass
return wrap(cls)
File "/opt/conda/envs/py/lib/python3.10/dataclasses.py", line 1175, in wrap
return _process_class(cls, init, repr, eq, order, unsafe_hash,
File "/opt/conda/envs/py/lib/python3.10/dataclasses.py", line 908, in _process_class
for b in cls.__mro__[-1:0:-1]:
File "/opt/conda/envs/py/lib/python3.10/unittest/mock.py", line 643, in __getattr__
raise AttributeError("Mock object has no attribute %r" % name)
AttributeError: Mock object has no attribute '__mro__'
For some reason it leads to dataclasses and errors out there. Code works fine normally, i am not sure why it does that. I thought it's uv
stuff but replicating the same env in the container also results in the same error. I'll have a look laterJuan Luis
10/01/2024, 2:25 PMkedro viz --lite
uses unittest Mock
. cc @Ravi Kumar Pilla @Rashida Kanchwala
@Fazil Topal do you mind opening an issue on Kedro Viz about this?Fazil Topal
10/01/2024, 2:44 PMFazil Topal
10/01/2024, 2:45 PM<http://kedro.io|kedro.io>.core.DatasetError: Class '<http://projx.models.audio.io|projx.models.audio.io>.LargeModel' not found, is this a typo?
Nok Lam Chan
10/01/2024, 2:46 PMopen a python terminal:projx.models.audio.io.LargeModel
from <http://projx.models.audio.io|projx.models.audio.io> import LargeModel
What do you get?Juan Luis
10/01/2024, 2:46 PMpython -c "from <http://projx.models.audio.io|projx.models.audio.io> import LargeModel"
works but kedro run
doesn't, then you have some problem with your installationFazil Topal
10/01/2024, 2:49 PMelevenlabs
so installing that fixed it. I wonder why that error is not thrown in kedro tho š¤Ravi Kumar Pilla
10/01/2024, 2:55 PMkedro viz --lite
, it only mocks dependencies within your kedro project. It does not mock any transitive dependencies. For this - i got the no module named elevenlabs so installing that fixed it. I wonder why that error is not thrown in kedro tho
do you mean kedro viz --lite
did not raise an error or kedro run
?Fazil Topal
10/01/2024, 3:04 PMFazil Topal
10/01/2024, 3:07 PMviz:
image: projx:viz
build:
context: .
target: viz
entrypoint: [ "bash" ]
command:
- -c
- "kedro viz run --host 0.0.0.0"
ports:
- 4141:4141
volumes:
- ./:/app
This returns error as bash: line 1: kedro: command not found
but when i comment the command
section, then run kedro viz run
inside the container it works. Does anyone have a clue? I feel like im missing something super obvious here š
Ravi Kumar Pilla
10/01/2024, 3:10 PMFazil Topal
10/01/2024, 3:13 PMENTRYPOINT ["kedro", "viz", "run", "--lite", "--host", "0.0.0.0"]
what's the best way to add kedro to containers bin path?Ravi Kumar Pilla
10/01/2024, 3:15 PMcommand:
- -c
- "source ~/.bashrc && kedro viz run --host 0.0.0.0"
Try if the above command works. If not, can you try installing kedro and kedro viz globally while creating the image ?Fazil Topal
10/01/2024, 3:16 PMNok Lam Chan
10/01/2024, 3:17 PMwhat's the best way to add kedro to containers bin path?You are not suppose to do that. Installing kedro-viz, should automatically add it to the python binary path already.
Fazil Topal
10/01/2024, 3:19 PMbashrc
so invoking that solved it. Now i see the kedro viz as expected. Thanks for the support š šFazil Topal
10/01/2024, 4:07 PMNok Lam Chan
10/01/2024, 4:08 PMbashrc
so invoking that solved it.
I think it's most likely the virtual envNok Lam Chan
10/01/2024, 4:09 PMFazil Topal
10/01/2024, 4:09 PMelevenlabs
was not thrown in kedroNok Lam Chan
10/01/2024, 4:12 PMFazil Topal
10/01/2024, 4:21 PMTraceback (most recent call last):
File "/opt/conda/envs/py/lib/python3.10/site-packages/kedro/io/core.py", line 159, in from_config
class_obj, config = parse_dataset_definition(
File "/opt/conda/envs/py/lib/python3.10/site-packages/kedro/io/core.py", line 501, in parse_dataset_definition
raise DatasetError(
kedro.io.core.DatasetError: Class 'projx.models.audio.io.LargeModel' not found, is this a typo?
Hint: If you are trying to use a dataset from `kedro-datasets`, make sure that the package is installed in your current environment. You can do so by running `pip install kedro-datasets` or `pip install kedro-datasets[<dataset-group>]` to install `kedro-datasets` along with related dependencies for the specific dataset group.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/conda/envs/py/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/opt/conda/envs/py/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/opt/conda/envs/py/lib/python3.10/site-packages/kedro_viz/server.py", line 122, in run_server
load_and_populate_data(
File "/opt/conda/envs/py/lib/python3.10/site-packages/kedro_viz/server.py", line 59, in load_and_populate_data
catalog, pipelines, session_store, stats_dict = kedro_data_loader.load_data(
File "/opt/conda/envs/py/lib/python3.10/site-packages/kedro_viz/integrations/kedro/data_loader.py", line 172, in load_data
return _load_data_helper(
File "/opt/conda/envs/py/lib/python3.10/site-packages/kedro_viz/integrations/kedro/data_loader.py", line 101, in _load_data_helper
catalog = context.catalog
File "/opt/conda/envs/py/lib/python3.10/site-packages/kedro/framework/context/context.py", line 190, in catalog
return self._get_catalog()
File "/opt/conda/envs/py/lib/python3.10/site-packages/kedro/framework/context/context.py", line 234, in _get_catalog
catalog: DataCatalog = settings.DATA_CATALOG_CLASS.from_config(
File "/opt/conda/envs/py/lib/python3.10/site-packages/kedro/io/data_catalog.py", line 330, in from_config
datasets[ds_name] = AbstractDataset.from_config(
File "/opt/conda/envs/py/lib/python3.10/site-packages/kedro/io/core.py", line 163, in from_config
raise DatasetError(
kedro.io.core.DatasetError: An exception occurred when parsing config for dataset 'narrator#lam':
Class 'projx.models.audio.io.LargeModel' not found, is this a typo?
Hint: If you are trying to use a dataset from `kedro-datasets`, make sure that the package is installed in your current environment. You can do so by running `pip install kedro-datasets` or `pip install kedro-datasets[<dataset-group>]` to install `kedro-datasets` along with related dependencies for the specific dataset group.
so this is what i saw and when i ran the import statement in the python as you suggested, i got this:
>>> from <http://projx.models.audio.io|projx.models.audio.io> import LargeModel
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/app/src/projx/models/audio/__init__.py", line 1, in <module>
from .base import LAM
File "/app/src/projx/models/audio/base.py", line 1, in <module>
from elevenlabs.client import ElevenLabs
ModuleNotFoundError: No module named 'elevenlabs'
so I sort of was expecting kedro to show this in the first place. If there is an open issue about it happy to comment it there, otherwise i'd open a new oneJuan Luis
10/15/2024, 10:55 AMso I sort of was expecting kedro to show this in the first place. If there is an open issue about it happy to comment it there, otherwise i'd open a new onesorry for the delay. I think we've improved this recently. @Fazil Topal what version of Kedro is this?
Fazil Topal
10/16/2024, 11:19 AMJuan Luis
10/16/2024, 12:17 PMNok Lam Chan
10/16/2024, 12:32 PMkedro.io.core.DatasetError: An exception occurred when parsing config for dataset 'ingestion.int_typed_companies':
No module named 'pandas'. Please see the documentation on how to install relevant dependencies for kedro_datasets.pandas.ParquetDataset:
https://docs.kedro.org/en/stable/kedro_project_setup/dependencies.html#install-dependencies-related-to-the-data-catalogThis is what happened when I try to use
pandas.CSVDataset
when I have kedro-datasets
installed but not `pandas`(pip uninstall on purpose)Fazil Topal
10/16/2024, 1:04 PMNok Lam Chan
10/16/2024, 1:07 PMdataset
module and init, and implemnetation file.
⢠some_dataset_module
⦠init.py
⦠some_dataset.py
We never directly import some_dataset, but usually through some_dataset_module
with from .some_dataset import XYZDataset
, and we also have lazy loading implemented, that could be another reason why we are able to catch error better for kedro-datasets
Fazil Topal
10/16/2024, 1:13 PMdataset_name
- init.py -> from .base import LAM
- base.py -> Wrapper code around aPI endpoint and defines LAM
- io.py -> Reads kedro config and create the LAM instance.
So basically module init would try to load the package elevenlabs
which is defined in the base
and that's the error that was not caught.
For the context, I use the dataset itself to import LAM to do type declaration for nodes hence the separate io file and base file.Juan Luis
11/13/2024, 4:22 PM