class documentation

LambdaDataSet loads and saves data to a data set. It relies on delegating to specific implementation such as csv, sql, etc.

LambdaDataSet class captures Exceptions while performing operations on composed DataSet implementations. The composed data set is responsible for providing information on how to resolve the issue when possible. This information should be available through str(error).

Example:

>>> from kedro.io import LambdaDataSet
>>> import pandas as pd
>>>
>>> file_name = "test.csv"
>>> def load() -> pd.DataFrame:
>>>     raise FileNotFoundError("'{}' csv file not found."
>>>                             .format(file_name))
>>> data_set = LambdaDataSet(load, None)
Method __init__ Creates a new instance of LambdaDataSet with references to the required input/output data set methods.
Method _describe Undocumented
Method _exists Undocumented
Method _load Undocumented
Method _release Undocumented
Method _save Undocumented
Instance Variable __exists Undocumented
Instance Variable __load Undocumented
Instance Variable __release Undocumented
Instance Variable __save Undocumented

Inherited from AbstractDataSet:

Class Method from_config Create a data set instance using the configuration provided.
Method __str__ Undocumented
Method exists Checks whether a data set's output already exists by calling the provided _exists() method.
Method load Loads data by delegation to the provided load method.
Method release Release any cached data.
Method save Saves data by delegation to the provided save method.
Method _copy Undocumented
Property _logger Undocumented
def __init__(self, load: Optional[Callable[[], Any]], save: Optional[Callable[[Any], None]], exists: Callable[[], bool] = None, release: Callable[[], None] = None): (source)

Creates a new instance of LambdaDataSet with references to the required input/output data set methods.

Parameters
load:Optional[Callable[[], Any]]Method to load data from a data set.
save:Optional[Callable[[Any], None]]Method to save data to a data set.
exists:Callable[[], bool]Method to check whether output data already exists.
release:Callable[[], None]Method to release any cached information.
Raises
DataSetErrorIf a method is specified, but is not a Callable.
def _describe(self) -> Dict[str, Any]: (source)

Undocumented

def _exists(self) -> bool: (source)

Undocumented

def _load(self) -> Any: (source)

Undocumented

def _release(self): (source)

Undocumented

def _save(self, data: Any): (source)

Undocumented

__exists = (source)

Undocumented

Undocumented

__release = (source)

Undocumented

Undocumented