feat: adding list of Data output to Parse Data
This pull request includes several changes to the ParseDataComponent class and related functions to enhance data processing capabilities. The most significant changes include adding new imports, updating input and output configurations, and modifying the data_to_text function to support more flexible data formatting.
Enhancements to data processing:
src/backend/base/langflow/components/processing/parse_data.py: Added import forDatafromlangflow.schema.
Updates to ParseDataComponent class:
src/backend/base/langflow/components/processing/parse_data.py: UpdatedDataInputto accept lists by settingis_list=True.src/backend/base/langflow/components/processing/parse_data.py: ModifiedOutputconfigurations to include additional information and added a new output methodparse_data_as_listfor processing data as a list.src/backend/base/langflow/components/processing/parse_data.py: Refactored theparse_datamethod to use a new helper method_parse, and added theparse_data_as_listmethod to handle list outputs.
Improvements to data_to_text function:
src/backend/base/langflow/helpers/data.py: Updated thedata_to_textfunction to return either a single string or a list of strings, depending on the presence of a separator. [1] [2]
CodSpeed Performance Report
Merging #4598 will improve performances by ×16
Comparing mieslep:phil/parse-data (a142b6e) with main (654b443)
Summary
⚡ 2 improvements
✅ 13 untouched benchmarks
Benchmarks breakdown
| Benchmark | main |
mieslep:phil/parse-data |
Change | |
|---|---|---|---|---|
| ⚡ | test_successful_run_with_output_type_any |
5,049.6 ms | 310.9 ms | ×16 |
| ⚡ | test_successful_run_with_output_type_debug |
321.6 ms | 228.9 ms | +40.54% |
Will modify to keep signature of data_to_text as -> str only.
@ogabrielluiz this should now be gtg from my perspective.