Combine
CombineColumns
¶
Bases: Step
CombineColumns is a Step that implements the process
method that calls the combine_dicts
function to handle and combine a list of StepInput
. Also CombineColumns
provides two attributes
columns
and output_columns
to specify the columns to merge and the output columns
which will override the default value for the properties inputs
and outputs
, respectively.
Attributes:
Name | Type | Description |
---|---|---|
columns |
List[str]
|
List of strings with the names of the columns to merge. |
output_columns |
Optional[List[str]]
|
Optional list of strings with the names of the output columns. |
Input columns
- dynamic, based on the
columns
value provided.
Output columns
- dynamic, based on the
output_columns
value provided ormerged_{column}
for each column incolumns
.
Source code in src/distilabel/steps/combine.py
inputs: List[str]
property
¶
The inputs for the task are the column names in columns
.
outputs: List[str]
property
¶
The outputs for the task are the column names in output_columns
or
merged_{column}
for each column in columns
.
process(*inputs)
¶
The process
method calls the combine_dicts
function to handle and combine a list of StepInput
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*inputs |
StepInput
|
A list of |
()
|
Yields:
Type | Description |
---|---|
StepOutput
|
A |