Skip to content

test: remove dead helper causing invalid tool provider constructor args#33124

Open
siewcapital wants to merge 1 commit intolanggenius:mainfrom
siewcapital:fix/32592-remove-invalid-tool-provider-helper
Open

test: remove dead helper causing invalid tool provider constructor args#33124
siewcapital wants to merge 1 commit intolanggenius:mainfrom
siewcapital:fix/32592-remove-invalid-tool-provider-helper

Conversation

@siewcapital
Copy link
Copy Markdown

@siewcapital siewcapital commented Mar 7, 2026

Summary

  • remove the unused _create_test_tool_provider helper from test_tools_transform_service.py
  • drop now-unused model imports in the same test file

Why

This helper was dead code and instantiated SQLAlchemy models with constructor keywords that don’t exist on those models (icon_dark, credentials, provider_type, etc.). That pattern was triggering the Unexpected keyword argument type errors reported in #32592, while adding no test coverage value because the helper is never called.

Removing the helper keeps behavior unchanged for runtime tests and eliminates a false-positive source in static checks.

Fixes #32592

Validation

  • uv run --project api --dev ruff check api/tests/test_containers_integration_tests/services/tools/test_tools_transform_service.py --fix
  • uv run --project api --dev pytest api/tests/unit_tests/services/tools/test_tools_transform_service.py -q

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Mar 7, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request streamlines a test file by removing a redundant helper function that was inadvertently introducing false-positive type errors. The helper, _create_test_tool_provider, was never called and incorrectly instantiated SQLAlchemy models, leading to issues in static analysis. Its removal cleans up the codebase, resolves a reported bug, and ensures that static checks provide more accurate feedback without altering the behavior of runtime tests.

Highlights

  • Code Cleanup: Removed the unused _create_test_tool_provider helper function from api/tests/test_containers_integration_tests/services/tools/test_tools_transform_service.py.
  • Dependency Optimization: Dropped now-unused model imports (BuiltinToolProvider, MCPToolProvider) that were only utilized by the removed helper function.
  • Bug Fix/Static Analysis Improvement: Addressed type errors reported in [Refactor/Chore] ERROR Unexpected keyword argument #32592 by eliminating a helper that instantiated SQLAlchemy models with invalid constructor arguments, thereby improving static check accuracy.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • api/tests/test_containers_integration_tests/services/tools/test_tools_transform_service.py
    • Removed the _create_test_tool_provider helper method.
    • Removed BuiltinToolProvider and MCPToolProvider from imports.
Activity
  • No human activity has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request removes the unused helper function _create_test_tool_provider and its associated unused imports from api/tests/test_containers_integration_tests/services/tools/test_tools_transform_service.py. The removed function was dead code and, as noted in the description, was causing static analysis errors by using incorrect constructor arguments. This change is a good cleanup, improving code health and maintainability by removing dead code.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 7, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-07 22:02:57.906808805 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-07 22:02:48.702738351 +0000
@@ -1179,28 +1179,6 @@
    --> tests/test_containers_integration_tests/services/test_workspace_service.py:530:28
 ERROR Cannot index into `object` [bad-index]
    --> tests/test_containers_integration_tests/services/test_workspace_service.py:532:28
-ERROR Unexpected keyword argument `icon_dark` in function `models.tools.ApiToolProvider.__init__` [unexpected-keyword]
-  --> tests/test_containers_integration_tests/services/tools/test_tools_transform_service.py:51:17
-ERROR Unexpected keyword argument `credentials` in function `models.tools.ApiToolProvider.__init__` [unexpected-keyword]
-  --> tests/test_containers_integration_tests/services/tools/test_tools_transform_service.py:54:17
-ERROR Unexpected keyword argument `provider_type` in function `models.tools.ApiToolProvider.__init__` [unexpected-keyword]
-  --> tests/test_containers_integration_tests/services/tools/test_tools_transform_service.py:55:17
-ERROR Unexpected keyword argument `description` in function `models.tools.BuiltinToolProvider.__init__` [unexpected-keyword]
-  --> tests/test_containers_integration_tests/services/tools/test_tools_transform_service.py:60:17
-ERROR Unexpected keyword argument `icon` in function `models.tools.BuiltinToolProvider.__init__` [unexpected-keyword]
-  --> tests/test_containers_integration_tests/services/tools/test_tools_transform_service.py:61:17
-ERROR Unexpected keyword argument `icon_dark` in function `models.tools.BuiltinToolProvider.__init__` [unexpected-keyword]
-  --> tests/test_containers_integration_tests/services/tools/test_tools_transform_service.py:62:17
-ERROR Unexpected keyword argument `credentials` in function `models.tools.BuiltinToolProvider.__init__` [unexpected-keyword]
-  --> tests/test_containers_integration_tests/services/tools/test_tools_transform_service.py:66:17
-ERROR Unexpected keyword argument `icon_dark` in function `models.tools.WorkflowToolProvider.__init__` [unexpected-keyword]
-  --> tests/test_containers_integration_tests/services/tools/test_tools_transform_service.py:73:17
-ERROR Unexpected keyword argument `workflow_id` in function `models.tools.WorkflowToolProvider.__init__` [unexpected-keyword]
-  --> tests/test_containers_integration_tests/services/tools/test_tools_transform_service.py:76:17
-ERROR Unexpected keyword argument `description` in function `models.tools.MCPToolProvider.__init__` [unexpected-keyword]
-  --> tests/test_containers_integration_tests/services/tools/test_tools_transform_service.py:81:17
-ERROR Unexpected keyword argument `provider_icon` in function `models.tools.MCPToolProvider.__init__` [unexpected-keyword]
-  --> tests/test_containers_integration_tests/services/tools/test_tools_transform_service.py:82:17
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
    --> tests/test_containers_integration_tests/services/tools/test_workflow_tools_manage_service.py:108:38
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor/Chore] ERROR Unexpected keyword argument

2 participants