Skip to content

Commit

Permalink
perf(datasets): lazily load datasets in init files
Browse files Browse the repository at this point in the history
Signed-off-by: Deepyaman Datta <[email protected]>
  • Loading branch information
deepyaman committed Jul 22, 2023
1 parent 8fb01ef commit 5d9db24
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 4 additions & 5 deletions kedro-datasets/kedro_datasets/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
It uses the python requests library: https://requests.readthedocs.io/en/latest/
"""

__all__ = ["APIDataSet"]
import lazy_loader as lazy

from contextlib import suppress

with suppress(ImportError):
from .api_dataset import APIDataSet
__getattr__, __dir__, __all__ = lazy.attach(
__name__, submod_attrs={"api_dataset": ["APIDataSet"]}
)
3 changes: 2 additions & 1 deletion kedro-datasets/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ description = "Kedro-Datasets is where you can find all of Kedro's data connecto
requires-python = ">=3.7, <3.11"
license = {text = "Apache Software License (Apache 2.0)"}
dependencies = [
"kedro>=0.16"
"kedro>=0.16",
"lazy_loader",
]
dynamic = ["readme", "version"]

Expand Down

0 comments on commit 5d9db24

Please sign in to comment.