langflow/src/backend/tests/unit
Rodrigo Nader 75c3c1ce97
feat: add batch run beta component (#5489)
* feat: add batch run beta component

* [autofix.ci] apply automated fixes

* Update batch_run to run async using Runnable

* [autofix.ci] apply automated fixes

* refactor: streamline BatchRunComponent by removing unused synchronous model invocation and enhancing async processing

- Consolidated imports and improved type checking for LanguageModel.
- Simplified the run_batch method by directly using the model's asynchronous capabilities.
- Enhanced error handling for missing DataFrame columns.
- Cleaned up comments and improved code readability.

* refactor: update BatchRunComponent to use Runnable for improved async processing

- Added future annotations for better type hinting.
- Replaced LanguageModel with Runnable in type checking and method implementation.
- Enhanced code clarity and maintainability by consolidating imports.

* test: add unit tests for BatchRunComponent functionality

- Introduced a new test suite for BatchRunComponent to validate its behavior.
- Added tests for successful batch runs with and without system messages.
- Implemented tests for handling invalid column names and empty DataFrames.
- Included a test to ensure non-string columns are converted to strings during processing.

* refactor: rename useful.py to mock_language_model.py and update imports

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-08 19:49:11 +00:00
..
api tests: fix tests by clearing service_manager services (#5573) 2025-01-08 13:13:41 +00:00
base ref: Some ruff fixes from preview (#5420) 2024-12-28 21:25:35 +00:00
components feat: add batch run beta component (#5489) 2025-01-08 19:49:11 +00:00
custom ref: Some ruff fixes from preview (#5420) 2024-12-28 21:25:35 +00:00
events ref: Some ruff fixes from preview (#5420) 2024-12-28 21:25:35 +00:00
exceptions ref: Some ruff fixes from preview (#5420) 2024-12-28 21:25:35 +00:00
graph ref: Some ruff fixes from preview (#5420) 2024-12-28 21:25:35 +00:00
helpers fix: resolve data keyword conflict in template formatting (#5483) 2024-12-31 13:13:31 +00:00
initial_setup feat: tool mode for all vector store components (#5348) 2024-12-19 16:49:09 +00:00
inputs ref: Add ALL ruff rules for tests (#4183) 2024-10-19 20:41:37 +00:00
io ref: Some ruff fixes from preview (#5420) 2024-12-28 21:25:35 +00:00
schema ref: Some ruff fixes from preview (#5420) 2024-12-28 21:25:35 +00:00
services feat: return variable value if it is a generic variable (#5366) 2024-12-19 17:04:00 +00:00
utils ref: Some ruff fixes from preview (#5420) 2024-12-28 21:25:35 +00:00
__init__.py refactor: move tests folder structure and update pytest commands (#2785) 2024-07-18 15:19:43 +00:00
mock_language_model.py feat: add batch run beta component (#5489) 2025-01-08 19:49:11 +00:00
test_api_key.py ref: Add ALL ruff rules for tests (#4183) 2024-10-19 20:41:37 +00:00
test_chat_endpoint.py fix: Use AsyncSession in memory (#4665) 2024-12-06 16:25:59 +00:00
test_cli.py refactor: remove unnecessary 'client' fixture and update test durations (#4283) 2024-10-27 14:16:45 +00:00
test_custom_component.py feat: Implement tool mode functionality and dynamic placeholders across input components (#4402) 2024-11-08 02:31:04 +00:00
test_custom_component_with_client.py ref: Make list_flows async (#5222) 2024-12-12 16:02:43 +00:00
test_data_class.py ref: Some ruff fixes from preview (#5420) 2024-12-28 21:25:35 +00:00
test_data_components.py ref: Apply ruff rule RUF052 (#5089) 2024-12-08 11:51:02 +00:00
test_database.py ref: Some ruff fixes from preview (#5420) 2024-12-28 21:25:35 +00:00
test_endpoints.py fix: Enable sorting of chat inputs to improve UI message speed (#4480) 2024-11-11 14:22:04 +00:00
test_experimental_components.py ref: Remove autouse from pytest client fixture (#4158) 2024-10-15 22:55:10 +00:00
test_frontend_nodes.py ref: Auto-fix ruff rules in tests (#4154) 2024-10-16 15:42:36 +00:00
test_helper_components.py feat: Refactor langflow Components - Consolidate Imports, Remove Unused Components, and Update Astra Assistant Icons (#4460) 2024-11-11 19:30:05 +00:00
test_initial_setup.py feat: Add support for loading flows and components from URLs (#5020) 2025-01-08 15:31:20 +00:00
test_kubernetes_secrets.py ref: Add ALL ruff rules for tests (#4183) 2024-10-19 20:41:37 +00:00
test_loading.py ref: Make load_flow_from_json async (#5057) 2024-12-11 17:53:33 +00:00
test_logger.py ref: Auto-fix ruff rules in tests (#4154) 2024-10-16 15:42:36 +00:00
test_login.py ref: Remove unused sync session_scope, with_session and engine (#5333) 2024-12-18 20:52:06 +00:00
test_messages.py ref: Remove unused sync session_scope, with_session and engine (#5333) 2024-12-18 20:52:06 +00:00
test_messages_endpoints.py ref: Remove unused sync session_scope, with_session and engine (#5333) 2024-12-18 20:52:06 +00:00
test_process.py ref: Remove some useless asyncio.to_thread (#5149) 2024-12-08 20:13:08 +01:00
test_schema.py ref: Some ruff fixes from preview (#5420) 2024-12-28 21:25:35 +00:00
test_setup_superuser.py fix: Use AsyncSession for user management (#4491) 2024-11-16 01:09:33 +00:00
test_telemetry.py ref: Some ruff fixes from preview (#5420) 2024-12-28 21:25:35 +00:00
test_template.py ref: Auto-fix ruff rules in tests (#4154) 2024-10-16 15:42:36 +00:00
test_user.py ref: Make initialize_database async (#5163) 2024-12-10 07:44:34 +01:00
test_validate_code.py feat: Allow variables to be defined outside a Component (#4316) 2024-10-29 06:45:38 -07:00
test_version.py ref: Auto-fix ruff rules in tests (#4154) 2024-10-16 15:42:36 +00:00
test_webhook.py feat: Bump blockbuster version to 1.5.0 (#5292) 2024-12-17 23:26:18 +01:00