The GitHub Actions job "Tests AMD" on airflow.git/add-comprehensive-compat-imports has failed. Run started by GitHub user kaxil (triggered by kaxil).
Head commit for run: 290797c9cd55e7ec945deeec221b30a873dfc023 / Kaxil Naik <[email protected]> Add comprehensive compatibility imports for Airflow 2 to 3 migration This change adds 94 compatibility imports to the common.compat provider to help users and Provider Maintainers migrate from Airflow 2.x to Airflow 3.x. The imports cover commonly used classes including hooks, sensors, operators, decorators, models, exceptions, assets, utilities, and entire moved modules. Key features: - Lazy imports using __getattr__ to avoid loading unnecessary modules - Multi-fallback support: tries Airflow 3 paths first, falls back to Airflow 2 - Separate maps for different import types: * _RENAME_MAP: Classes renamed between versions (Asset/Dataset) * _IMPORT_MAP: Classes/functions that moved but kept same name * _MODULE_MAP: Entire modules that moved (timezone, io) - Type stubs (.pyi) for full IDE autocomplete support - Prek hook to keep type stubs in sync with import maps - Optional import validation for developers with full Airflow installed Users and Provider Authors/Maintainers can now import from airflow.providers.common.compat.lazy_compat: ```py from airflow.providers.common.compat.lazy_compat import ( BaseHook, BaseOperator, PythonOperator, Asset, # was Dataset in 2.x, automatically handled DAG, task, timezone, # entire module io, # entire module ) now = timezone.utcnow() fs = io.get_fs("s3://bucket/path") asset = Asset(uri="s3://bucket/key") # Dataset in 2.x, Asset in 3.x ``` This enables DAG code to work seamlessly across both Airflow 2.10+ and 3.x without modification, supporting phased migration strategies. Renamed classes supported (2.x → 3.x): - Dataset → Asset - DatasetAlias → AssetAlias - DatasetAll → AssetAll - DatasetAny → AssetAny Benefits: - Single source of truth for compatibility imports - Cleaner, more maintainable code with explicit handling of renames vs. moves - Easy to add more imports and renames in the future - Better error messages for debugging - Reduces boilerplate in provider code Benefits: - Single source of truth for compatibility imports - Cleaner, more maintainable code with explicit handling of renames vs. moves - Easy to add more imports and renames in the future - Better error messages for debugging - Reduces boilerplate in provider code Report URL: https://github.com/apache/airflow/actions/runs/18607577794 With regards, GitHub Actions via GitBox --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
