langflow/src/backend/tests/unit
VICTOR CORREA GOMES 3474259ca4
refactor: Calculator Component updating tool implementation and fix deprecation warnings (#5442)
* refactor(calculator): update tool implementation

Replace legacy tool mode implementation using CalculatorToolSchema with simplified tool_mode=True approach.

* refactor(calculator): fix deprecation warnings

Fix ast.Num deprecation warnings by supporting ast.Constant while maintaining backwards compatibility.

* Update isinstance check to use Python 3.10+ union operator (|) instead of tuple syntax

* Update calculator.py

Component name required; if not it would get None in Toolset

* [autofix.ci] apply automated fixes

* test(calculator): add unit tests for CalculatorToolComponent

* revert(tools): restore Calculator component to its original implementation

Due to potential breaking changes in the repository, reverting the Calculator
component to its initial PR state to maintain compatibility and stability.

* feat(tools): mark Calculator component as legacy and update display name

- Set legacy flag to true for Calculator component
- Update display name to "Calculator (Deprecated)" to clearly indicate deprecation status
- Maintain backward compatibility by preserving class name and internal name

* feat(tools)!: add new calculator core component

BREAKING CHANGE: Introduces calculator_core.py as a replacement for the deprecated calculator.py

* refactor(tools): rename calculator classes for better distinction

* refactor(tools): update __init__.py to reflect new class names

* [autofix.ci] apply automated fixes

* test(tools): update calculator tests for core component

---------

Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-17 20:55:12 +00:00
..
api feat: add truncation to ResultDataResponse (#5704) 2025-01-16 18:39:34 +00:00
base feat: Bump ruff version to 0.9 (#5666) 2025-01-15 15:14:43 +00:00
components refactor: Calculator Component updating tool implementation and fix deprecation warnings (#5442) 2025-01-17 20:55:12 +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 feat: Bump ruff version to 0.9 (#5666) 2025-01-15 15:14:43 +00:00
helpers fix: resolve data keyword conflict in template formatting (#5483) 2024-12-31 13:13:31 +00:00
initial_setup feat: Bump ruff version to 0.9 (#5666) 2025-01-15 15:14:43 +00:00
inputs fix: pass slider input values correctly, add test (#5735) 2025-01-16 18:41:17 +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 refactor: add graph utility tests and refactor sorting methods (#5538) 2025-01-09 20:15:24 +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_database.py ref: Some ruff fixes from preview (#5420) 2024-12-28 21:25:35 +00:00
test_endpoints.py Fix: update tweaks processing to allow input_type without input_value (#5656) 2025-01-15 20:43:19 +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: Bump ruff version to 0.9 (#5666) 2025-01-15 15:14:43 +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 refactor: add graph utility tests and refactor sorting methods (#5538) 2025-01-09 20:15:24 +00:00