test: remove dead helper causing invalid tool provider constructor args#33124
test: remove dead helper causing invalid tool provider constructor args#33124siewcapital wants to merge 1 commit intolanggenius:mainfrom
Conversation
Summary of ChangesHello, 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, Highlights
🧠 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
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
Pyrefly Diffbase → 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]
|
Summary
_create_test_tool_providerhelper fromtest_tools_transform_service.pyWhy
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 theUnexpected keyword argumenttype 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 --fixuv run --project api --dev pytest api/tests/unit_tests/services/tools/test_tools_transform_service.py -q