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 fromDataset.file_path.notebook_id: the notebook's own working copy, read fromNotebook.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
LoadDatasetUnitDo the unit's work, reading from and writing to the context.
Parameters
- ctx : ExecutionContext
- The shared execution context.
get_credential(self, name: str)
ConfigObjectResolve 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
ConfigObjectGenerates the component related Json Schema.
Returns
- dict
- Dictionary representing the Json Schema of the component.
validate(self, ctx: DashAI.back.units.context.ExecutionContext) -> None
BaseUnitCheck preconditions without executing the unit.
Parameters
- ctx : ExecutionContext
- The shared execution context.
validate_and_transform(self, raw_data: dict) -> dict
ConfigObjectIt 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.