Skip to content

Commit

Permalink
perf(datasets): lazily load datasets in init files (biosequence)
Browse files Browse the repository at this point in the history
Signed-off-by: Deepyaman Datta <[email protected]>
  • Loading branch information
deepyaman committed Jul 23, 2023
1 parent c8c3541 commit 6b42018
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
1 change: 0 additions & 1 deletion kedro-datasets/kedro_datasets/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
and returns them into either as string or json Dict.
It uses the python requests library: https://requests.readthedocs.io/en/latest/
"""

from typing import Any

import lazy_loader as lazy
Expand Down
11 changes: 7 additions & 4 deletions kedro-datasets/kedro_datasets/biosequence/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
"""``AbstractDataSet`` implementation to read/write from/to a sequence file."""
from typing import Any

__all__ = ["BioSequenceDataSet"]
import lazy_loader as lazy

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

with suppress(ImportError):
from .biosequence_dataset import BioSequenceDataSet
__getattr__, __dir__, __all__ = lazy.attach(
__name__, submod_attrs={"biosequence_dataset": ["BiosequenceDataSet"]}
)
2 changes: 0 additions & 2 deletions kedro-datasets/kedro_datasets/pandas/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""``AbstractDataSet`` implementations that produce pandas DataFrames."""

from typing import Any

import lazy_loader as lazy
Expand All @@ -19,7 +18,6 @@
SQLTableDataSet: Any
XMLDataSet: Any


__getattr__, __dir__, __all__ = lazy.attach(
__name__,
submod_attrs={
Expand Down

0 comments on commit 6b42018

Please sign in to comment.