Skip to main content

LoadUploadedDatasetUnit

Unit
DashAI.back.units.LoadUploadedDatasetUnit

Parse a file or URL into a dataset with the chosen reader.

The counterpart of LoadDatasetUnit: that one materialises something DashAI already stores, this one brings in data that is not a dataset yet. So it publishes only dataset — there is no stored id to correlate against and no path to save back to, because nothing decided yet where the result belongs.

Types are not applied here. What the reader produces is whatever the source suggests; declaring and casting types is a separate step, so the same load can be reviewed before anything is committed to.

Parameters​

dataloader : object
Reader used to parse the source, together with its own configuration (delimiter, sheet, encoding, and so on).
source : string, default=
Where to read from: a path to a local file or a URL. Archives are downloaded and extracted before being parsed.
n_sample, default=None
Read only this many rows instead of the whole source. Leave empty to read everything.

Methods​

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

Defined on LoadUploadedDatasetUnit

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.