SZL741023 opened a new pull request, #73466:
URL: https://github.com/apache/airflow/pull/73466
## Why
`DataFusionEngine.get_schema()` returned a pre-formatted string. An agent's
`get_schema` tool call needs JSON, so `DataFusionToolset` bypassed the engine
and read the session context directly (a TODO left in #62850).
The two schema paths in common.ai also disagreed: the database-hook path
produced comma-joined `name type` pairs, while the object-storage path embedded
a raw Arrow schema repr, so one prompt could describe two tables in two
different shapes.
## What changed
- `DataFusionEngine.get_schema()` returns `list[dict[str, str]]` with `name`
and `type` keys, matching `DbApiHook.get_table_schema()`.
- `LLMSQLQueryOperator` and `LLMSchemaCompareOperator` format both schema
paths with one shared helper.
- `DataFusionToolset.get_schema` goes through the engine and returns
`{"error": ...}` JSON when schema lookup fails, as its `query` tool already
does.
- Existing tests that mocked `get_schema()` with strings now use the new
return type, and their prompt-text assertions expect the `name type, ...`
format.
## Breaking change
Direct callers of `DataFusionEngine.get_schema()` get a list instead of a
string. The common.sql changelog carries a warning with the migration. The
common-sql bound in common.ai is marked `# use next version` so the release
manager pins it to the release that contains this change.
## Tests
Run locally after rebasing on `main`:
- [x] `pytest` for common.ai `operators/`, `toolsets/test_datafusion.py`,
`utils/test_schema_context.py`: 414 passed
- [x] `pytest` for common.sql `datafusion/`: 64 passed
- [x] `prek run --from-ref upstream/main --stage pre-commit`: passed
- [x] `mypy-providers` on the five changed source files: no issues
Selective checks select the broader provider test suite; that is left to CI.
related: #62850
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — Claude Code (Opus 5)
Generated-by: Claude Code (Opus 5) following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
--
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]