From 51f2f468fa50163f284cc8c85f4e5733af571135 Mon Sep 17 00:00:00 2001 From: Deepyaman Datta Date: Sat, 29 Jul 2023 02:30:17 -0500 Subject: [PATCH] perf(datasets): lazily load datasets in init files (video) Signed-off-by: Deepyaman Datta --- kedro-datasets/kedro_datasets/video/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kedro-datasets/kedro_datasets/video/__init__.py b/kedro-datasets/kedro_datasets/video/__init__.py index 8bfb41fe6..a7d2ea14a 100644 --- a/kedro-datasets/kedro_datasets/video/__init__.py +++ b/kedro-datasets/kedro_datasets/video/__init__.py @@ -1,5 +1,11 @@ """Dataset implementation to load/save data from/to a video file.""" +from typing import Any -__all__ = ["VideoDataSet"] +import lazy_loader as lazy -from .video_dataset import VideoDataSet +# https://github.com/pylint-dev/pylint/issues/4300#issuecomment-1043601901 +VideoDataSet: Any + +__getattr__, __dir__, __all__ = lazy.attach( + __name__, submod_attrs={"video_dataset": ["VideoDataSet"]} +)