-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
feat(component): enhance merge data with standard operations #5125
feat(component): enhance merge data with standard operations #5125
Conversation
- Add standard merge operations (concatenate, append, merge, join) - Add operation selection via dropdown - Return DataFrame output type - Implement separate merge strategies
- Add MIN_INPUTS_REQUIRED constant - Use descriptive DataFrame variable names - Move return statement to else block - Use list comprehension for better performance - Fix unused loop variable - Improve overall code formatting
30f0388
to
aff4dd9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @raphaelchristi
How are you?
langflow.schema.DataFrame
works exactly like a pd.DataFrame so you don't have to do anything differently while using it. It just has some helper features and methods.
Co-authored-by: Gabriel Luiz Freitas Almeida <[email protected]>
b31c5f2
to
344127d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, use only english in the component.
- Improved type hinting for combined data structures to enhance code clarity. - Streamlined the concatenation and merging operations to ensure consistent handling of string and object types. - Updated the logic to correctly append values to lists when merging data inputs, improving data integrity in the merging process.
- Deleted the DataMergerComponent to streamline the processing components. - Updated the __init__.py file to reflect the removal of the DataMergerComponent from the exports.
- Introduced a new enum, MergeOperation, to define various data merging strategies: CONCATENATE, APPEND, MERGE, and JOIN. - Updated the merge_data method to return a DataFrame instead of a list of Data objects, improving data handling. - Enhanced input validation to ensure a minimum number of data inputs are provided. - Streamlined the merging logic to support different operations, improving flexibility and usability of the component.
- Moved MIN_INPUTS_REQUIRED constant outside the class for better visibility and consistency. - Updated the merge_data method to reference the new constant instead of the class attribute. - Improved error logging message for clarity.
Description
This PR refactors the Merge Data component, introducing improved functionality and clarity to the merging process.
Changes
Standardized Merge Operations:
concatenate
: Combines text values with newlines.append
: Adds data as new rows.merge
: Combines values into lists.join
: Adds columns with suffixes.Output Improvements:
Documentation:
Error Handling:
Refactored Merge Logic:
UI Enhancements:
Code Comparison
Before
After
Benefits