Lee-W commented on code in PR #74695:
URL: https://github.com/apache/airflow/pull/74695#discussion_r4269151188
##########
providers/common/ai/src/airflow/providers/common/ai/toolsets/sql.py:
##########
@@ -429,10 +444,11 @@ async def execute_tool(
ctx: RunContext[Any],
tool: ToolsetTool[Any],
) -> Any:
- if name not in ("list_tables", "get_schema", "query", "check_query"):
+ base = name.removeprefix(f"{self._tool_prefix}_") if self._tool_prefix
else name
+ if base not in ("list_tables", "get_schema", "query", "check_query"):
raise ValueError(f"Unknown tool: {name!r}")
try:
- return await self.run_blocking(self._run_tool, name, tool_args)
+ return await self.run_blocking(self._run_tool, base, tool_args)
Review Comment:
These are now built from the the toolset's own tool names.
* retry text
* `allowed_tables` refusals
* DataFusion retry
* `get_schema` description and hints
`build_schema_result` takes the `get_schema` name as a keyword argument, and
the unprefixed text is unchanged.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]