Skip to content

Commit

Permalink
perf(datasets): lazily load datasets in init files (yaml)
Browse files Browse the repository at this point in the history
Signed-off-by: Deepyaman Datta <[email protected]>
  • Loading branch information
deepyaman committed Jul 29, 2023
1 parent 51f2f46 commit f237a8b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions kedro-datasets/kedro_datasets/yaml/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
"""``AbstractDataSet`` implementation to load/save data from/to a YAML file."""
from typing import Any

__all__ = ["YAMLDataSet"]
import lazy_loader as lazy

from contextlib import suppress
# https://github.com/pylint-dev/pylint/issues/4300#issuecomment-1043601901
YAMLDataSet: Any

with suppress(ImportError):
from .yaml_dataset import YAMLDataSet
__getattr__, __dir__, __all__ = lazy.attach(
__name__, submod_attrs={"yaml_dataset": ["YAMLDataSet"]}
)

0 comments on commit f237a8b

Please sign in to comment.