Saltar al contenido principal

InferDatasetTypesUnit

Unit
DashAI.back.units.InferDatasetTypesUnit

Publish a type declaration for every column of the dataset.

Prefers the types the dataset already carries: a dataloader that can read them from the source (a Parquet schema, a typed database column) knows better than any inference over the values, so re-inferring would throw that away. Only when there are none does it fall back to inferring from the data.

Publishes the declaration as a plain reference rather than applying it, so the decision and the transformation stay separable — the same declaration can be shown to a user for review before anything is cast.

Note the reference names columns, so it goes stale the moment something renames or drops one. It is meant to be consumed by the next step, not carried across a chain of transformations.

Parameters​

method : string, default=DashAIPtype
Inference method used when the dataset does not already carry types of its own.

Methods​

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

Defined on InferDatasetTypesUnit

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.