Andrew Stewart
04/12/2024, 9:51 PMkedro-viz
or is this obviously something outside that scope / upstream (such as something gnarly with the pipeline definition or something):
$ kedro viz build
[04/12/24 14:30:18] ERROR Failed to save node data for node ID 2aa90f47. Error: 'str' object has no attribute 'get' responses.py:430
╭───────────────────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────────────────╮
│ /home/.venv/lib/python3.9/site-packages/kedro_viz/api/rest/responses.py:427 in │
│ save_api_node_response_to_fs │
│ │
│ 424 │ for nodeId in data_access_manager.nodes.get_node_ids(): │
│ 425 │ │ try: │
│ 426 │ │ │ write_api_response_to_fs( │
│ ❱ 427 │ │ │ │ f"{nodes_path}/{nodeId}", get_node_metadata_response(nodeId), remote_fs │
│ 428 │ │ │ ) │
│ 429 │ │ except Exception as exc: # pragma: no cover │
│ 430 │ │ │ logger.exception( │
│ │
│ /home/.venv/lib/python3.9/site-packages/kedro_viz/api/rest/responses.py:336 in │
│ get_node_metadata_response │
│ │
│ 333 │ │ return TaskNodeMetadata(task_node=node) │
│ 334 │ │
│ 335 │ if isinstance(node, DataNode): │
│ ❱ 336 │ │ return DataNodeMetadata(data_node=node) │
│ 337 │ │
│ 338 │ if isinstance(node, TranscodedDataNode): │
│ 339 │ │ return TranscodedDataNodeMetadata(transcoded_data_node=node) │
│ │
│ /home/.venv/lib/python3.9/site-packages/pydantic/main.py:175 in __init__ │
│ │
│ 172 │ │ """ │
│ 173 │ │ # `__tracebackhide__` tells pytest and some other tools to omit this function │
│ from tracebacks │
│ 174 │ │ __tracebackhide__ = True │
│ ❱ 175 │ │ self.__pydantic_validator__.validate_python(data, self_instance=self) │
│ 176 │ │
│ 177 │ # The following line sets a flag that we use to determine when `__init__` gets │
│ overridden by the user │
│ 178 │ __init__.__pydantic_base_init__ = True # pyright: │
│ ignore[reportFunctionMemberAccess] │
│ │
│ /home/.venv/lib/python3.9/site-packages/kedro_viz/models/flowchart.py:790 in │
│ set_filepath │
│ │
│ 787 │ @classmethod │
│ 788 │ def set_filepath(cls, _): │
│ 789 │ │ dataset_description = cls.dataset._describe() │
│ ❱ 790 │ │ return _parse_filepath(dataset_description) │
│ 791 │ │
│ 792 │ @field_validator("run_command") │
│ 793 │ @classmethod │
│ │
│ /home/.venv/lib/python3.9/site-packages/kedro_viz/models/flowchart.py:43 in │
│ _parse_filepath │
│ │
│ 40 │
│ 41 │
│ 42 def _parse_filepath(dataset_description: Dict[str, Any]) -> Optional[str]: │
│ ❱ 43 │ filepath = dataset_description.get("filepath") or dataset_description.get("path") │
│ 44 │ return str(filepath) if filepath else None │
│ 45 │
│ 46 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'str' object has no attribute 'get'
Deepyaman Datta
04/13/2024, 1:54 AM_describe
method of the dataset may be returning a str
instead of a dict
?Andrew Stewart
04/15/2024, 9:11 PM