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

feat: Improve data handling and text formatting (loop fix) #6771

Merged
merged 14 commits into from
Feb 24, 2025

Conversation

Cristhianzl
Copy link
Member

This pull request includes several changes to improve the handling of data and text formatting in the langflow backend. The most important changes include updates to the data_to_text_list function, enhancements to the LoopComponent class, and the addition of new tests for the data_to_text_list function.

Improvements to data handling and text formatting:

  • src/backend/base/langflow/helpers/data.py: Refactored the data_to_text_list function to handle various data structures, support nested dictionaries, and use safe string formatting with fallbacks for missing keys. Added detailed docstrings and examples for better understanding.

Enhancements to loop component:

Addition of new tests:

Additional imports:

…eturn condition in the LoopComponent class

📝 (data.py): Enhance the data_to_text_list function to handle various data structures and ensure consistent text formatting
📝 (LoopTemplate.json): Update the LoopComponent class description and method implementations for better clarity and maintainability
📝 (test_data_to_text_list.py): Add unit tests to cover different scenarios and edge cases for the data_to_text_list function
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Feb 23, 2025
@Cristhianzl Cristhianzl self-assigned this Feb 23, 2025
@github-actions github-actions bot added the enhancement New feature or request label Feb 23, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Feb 23, 2025
…fic files in the project. Fix type annotations and improve error handling in data.py module. Add noqa comments to ignore linting rule A005 for specific files in the project.
…parametrize to improve readability and maintainability
…lity and maintainability

🔧 (test_data_to_text_list.py): simplify test_data_to_text_list_complex_nested_data test case for better clarity and conciseness
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Feb 23, 2025
…ction to improve readability and maintainability
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Feb 23, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Feb 23, 2025
Copy link

codspeed-hq bot commented Feb 23, 2025

CodSpeed Performance Report

Merging #6771 will not alter performance

Comparing cz/fix-data-to-text-list (711fa7a) with main (05935ed)

Summary

✅ 14 untouched benchmarks

Co-authored-by: Gabriel Luiz Freitas Almeida <[email protected]>
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Feb 24, 2025
…ic and improve readability by removing unnecessary if conditions and updating the format_dict directly from data_obj.data.
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 24, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Feb 24, 2025
…defaultdict behavior and improve test coverage
…ect number of occurrences of "modified_value" in the output
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Feb 24, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Feb 24, 2025
@Cristhianzl Cristhianzl added this pull request to the merge queue Feb 24, 2025
Merged via the queue into main with commit 7b85505 Feb 24, 2025
37 checks passed
@Cristhianzl Cristhianzl deleted the cz/fix-data-to-text-list branch February 24, 2025 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants