Skip to main content

LoadDatasetUnit

Unit
DashAI.back.units.LoadDatasetUnit

Load a dataset from disk into the execution context.

Takes exactly one of two starting points and materialises the dataset each one points at, so downstream units receive a dataset instead of an identifier:

  • dataset_id: the stored dataset itself, read from Dataset.file_path.
  • notebook_id: the notebook's own working copy, read from Notebook.file_path. A notebook holds a private copy precisely so converters can rewrite it without touching the source dataset.

Either way the unit publishes dataset_path, which is where a later unit has to write the dataset back for the change to be visible.

Parameters​

dataset_id, default=None
Identifier of the stored dataset to load. Mutually exclusive with the notebook identifier.
notebook_id, default=None
Identifier of the notebook whose working copy of the dataset should be loaded. Mutually exclusive with the dataset identifier.

Methods​

execute(self, ctx: DashAI.back.units.context.ExecutionContext) -> None

Defined on LoadDatasetUnit

Do the unit's work, reading from and writing to the context.

Parameters

ctx : ExecutionContext
The shared execution context.

get_credential(self, name: str)

Defined on ConfigObject

Resolve a registered credential component by name.

Parameters

name : str
Credential component class name (e.g. "HuggingFaceCredential").

Returns

BaseCredential
An instance of the requested credential component.

get_schema(cls) -> dict

Defined on ConfigObject

Generates the component related Json Schema.

Returns

dict
Dictionary representing the Json Schema of the component.

validate(self, ctx: DashAI.back.units.context.ExecutionContext) -> None

Defined on BaseUnit

Check preconditions without executing the unit.

Parameters

ctx : ExecutionContext
The shared execution context.

validate_and_transform(self, raw_data: dict) -> dict

Defined on ConfigObject

It takes the data given by the user to initialize the model and returns it with all the objects that the model needs to work.

Parameters

raw_data : dict
A dictionary with the data provided by the user to initialize the model.

Returns

dict
A validated dictionary with the necessary objects.