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

refactor: Calculator Component updating tool implementation and fix deprecation warnings #5442

Merged
merged 20 commits into from
Jan 17, 2025

Conversation

Vigtu
Copy link
Contributor

@Vigtu Vigtu commented Dec 25, 2024

refactor(calculator): update tool implementation and fix deprecation warnings

  • Replace legacy tool mode implementation using CalculatorToolSchema with simplified tool_mode=True approach.
  • Fix ast.Num deprecation warnings by supporting ast.Constant while maintaining backwards compatibility.

image
image

This pull request includes the addition of a new CalculatorComponent and the deprecation of the existing CalculatorToolComponent. The changes involve updating the initialization file to include the new component, modifying the old component to mark it as deprecated, and adding comprehensive unit tests for the new component.

Addition of new CalculatorComponent:

Deprecation of existing CalculatorToolComponent:

Unit tests for CalculatorComponent:

Replace legacy tool mode implementation using CalculatorToolSchema with simplified tool_mode=True approach.
Fix ast.Num deprecation warnings by supporting ast.Constant while maintaining backwards compatibility.
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Dec 25, 2024
@github-actions github-actions bot added the refactor Maintenance tasks and housekeeping label Dec 25, 2024
@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Dec 25, 2024
@Vigtu
Copy link
Contributor Author

Vigtu commented Dec 30, 2024

@carlosrcoelho

@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Jan 6, 2025
Component name required; if not it would get None in Toolset
@edwinjosechittilappilly
Copy link
Collaborator

LGTM

@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Jan 9, 2025
Copy link
Collaborator

@edwinjosechittilappilly edwinjosechittilappilly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure to have Name variable in component such that it would be used in the Edit tools table later.

@github-actions github-actions bot added the refactor Maintenance tasks and housekeeping label Jan 9, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 9, 2025
@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Jan 9, 2025
Copy link

codspeed-hq bot commented Jan 9, 2025

CodSpeed Performance Report

Merging #5442 will degrade performances by 32.87%

Comparing Vigtu:calculator-overhaul (bf0e59f) with main (3193804)

Summary

⚡ 1 improvements
❌ 1 regressions
✅ 13 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main Vigtu:calculator-overhaul Change
test_successful_run_with_input_type_text 4,243.8 ms 249.4 ms ×17
test_successful_run_with_output_type_debug 167.3 ms 249.3 ms -32.87%

@edwinjosechittilappilly
Copy link
Collaborator

@Vigtu can you check and fix why the unit test are failing?

@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Jan 10, 2025
@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Jan 17, 2025
@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Jan 17, 2025
@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Jan 17, 2025
@Vigtu
Copy link
Contributor Author

Vigtu commented Jan 17, 2025

@Vigtu can we get these changes in by Today (friday) ? Please let me know if there are any blockers!

Done

@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Jan 17, 2025
@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Jan 17, 2025
Copy link
Collaborator

@edwinjosechittilappilly edwinjosechittilappilly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 17, 2025
@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Jan 17, 2025
@edwinjosechittilappilly edwinjosechittilappilly changed the title refactor(calculator): update tool implementation and fix deprecation warnings refactor: Calculator Component updating tool implementation and fix deprecation warnings Jan 17, 2025
@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Jan 17, 2025
@edwinjosechittilappilly edwinjosechittilappilly added this pull request to the merge queue Jan 17, 2025
Merged via the queue into langflow-ai:main with commit 3474259 Jan 17, 2025
33 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer refactor Maintenance tasks and housekeeping 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