Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add combine_dicts function and CombineColumns class #358

Merged
merged 4 commits into from
Feb 23, 2024

Conversation

alvarobartt
Copy link
Member

@alvarobartt alvarobartt commented Feb 23, 2024

Description

This PR adds the combine_dicts function to combine the columns of *StepInput into a single one i.e. the result is a Python dictionary where each key contains a list as a value.

Additionally, this PR also includes the CombineColumns class which is a class inheriting from Step which implements the process method that calls the combine_dicts function. Also the inputs and ouputs properties are defined by the attributes merge_columns and output_merge_columns, respectively.

Example

from distilabel.pipeline.step.combine import CombineColumns

step = CombineColumns(
    merge_columns=["generation", "model_name"],
    output_merge_columns=["generations", "model_names"],
)

@alvarobartt alvarobartt added the enhancement New feature or request label Feb 23, 2024
@alvarobartt alvarobartt added this to the 1.0.0 milestone Feb 23, 2024
@alvarobartt alvarobartt self-assigned this Feb 23, 2024
@alvarobartt alvarobartt changed the base branch from main to core-refactor February 23, 2024 13:01
@alvarobartt alvarobartt marked this pull request as ready for review February 23, 2024 13:09
@alvarobartt alvarobartt merged commit 22ce8fc into core-refactor Feb 23, 2024
4 checks passed
@alvarobartt alvarobartt deleted the combine-step branch February 23, 2024 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants