airflow.providers.common.ai.decorators.llm_schema_compare¶
TaskFlow decorator for cross-system schema drift detection.
The user writes a function that returns the prompt. The decorator handles schema introspection from multiple data sources, LLM-powered comparison, and structured output of detected mismatches.
Functions¶
|
Wrap a function that returns a prompt into an LLM schema comparison task. |
Module Contents¶
- airflow.providers.common.ai.decorators.llm_schema_compare.llm_schema_compare_task(python_callable=None, **kwargs)[source]¶
Wrap a function that returns a prompt into an LLM schema comparison task.
The function body constructs the prompt (can use Airflow context, XCom, etc.). The decorator handles: schema introspection from multiple data sources, LLM-powered cross-system type comparison, and structured mismatch output.
Usage:
@task.llm_schema_compare( llm_conn_id="openai_default", db_conn_ids=["postgres_source", "snowflake_target"], table_names=["customers"], ) def check_migration_readiness(): return "Compare schemas and flag breaking changes"
- Parameters:
python_callable (collections.abc.Callable | None) – Function to decorate.