amoghrajesh opened a new issue, #54714: URL: https://github.com/apache/airflow/issues/54714
### Body ## Description We need to implement ruff rules to catch and/or auto-fix deprecated imports in Airflow for Airflow 3.1. These rules should help users migrate from old import paths to new ones. ## Implementation Checklist ### airflow.utils module - [ ] `airflow.utils.setup_teardown.BaseSetupTeardownContext` → `airflow.sdk.definitions._internal.setup_teardown.BaseSetupTeardownContext` - [ ] `airflow.utils.setup_teardown.SetupTeardownContext` → `airflow.sdk.definitions._internal.setup_teardown.SetupTeardownContext` - [ ] `airflow.utils.xcom.XCOM_RETURN_KEY` → `airflow.models.xcom.XCOM_RETURN_KEY` - [ ] `airflow.utils.task_group.TaskGroup` → `airflow.sdk.TaskGroup` - [ ] `airflow.utils.task_group.get_task_group_children_getter` → `airflow.sdk.definitions.taskgroup.get_task_group_children_getter` - [ ] `airflow.utils.task_group.task_group_to_dict` → `airflow.sdk.definitions.taskgroup.task_group_to_dict` - [ ] `airflow.utils.timezone.*` → `airflow.sdk.timezone` - [ ] `airflow.utils.decorators.remove_task_decorator` → `airflow.sdk.definitions._internal.decorators.remove_task_decorator` - [ ] `airflow.utils.decorators.fixup_decorator_warning_stack` → `airflow.sdk.definitions._internal.decorators.fixup_decorator_warning_stack` ### airflow.sensors module - [ ] `airflow.sensors.base.BaseSensorOperator` → `airflow.sdk.bases.sensor.BaseSensorOperator` - [ ] `airflow.sensors.base.PokeReturnValue` → `airflow.sdk.bases.sensor.PokeReturnValue` - [ ] `airflow.sensors.base.poke_mode_only` → `airflow.sdk.bases.sensor.poke_mode_only` - [ ] `airflow.sensors.python.PythonSensor` → `airflow.providers.standard.sensors.python.PythonSensor` - [ ] `airflow.sensors.bash.BashSensor` → `airflow.providers.standard.sensors.bash.BashSensor` - [ ] `airflow.sensors.date_time.DateTimeSensor` → `airflow.providers.standard.sensors.date_time.DateTimeSensor` - [ ] `airflow.sensors.date_time.DateTimeSensorAsync` → `airflow.providers.standard.sensors.date_time.DateTimeSensorAsync` ### airflow.secrets module - [ ] `airflow.secrets.cache.SecretCache` → `airflow.sdk.execution_time.cache.SecretCache` ### airflow.notifications module - [ ] `airflow.notifications.basenotifier.BaseNotifier` → `airflow.sdk.bases.notifier.BaseNotifier` ### airflow.models module - [ ] `airflow.models.abstractoperator.AbstractOperator` → `airflow.sdk.definitions._internal.abstractoperator.AbstractOperator` - [ ] `airflow.models.abstractoperator.NotMapped` → `airflow.sdk.definitions._internal.abstractoperator.NotMapped` - [ ] `airflow.models.abstractoperator.TaskStateChangeCallback` → `airflow.sdk.definitions._internal.abstractoperator.TaskStateChangeCallback` - [ ] `airflow.models.param.Param` → `airflow.sdk.definitions.param.Param` - [ ] `airflow.models.param.ParamsDict` → `airflow.sdk.definitions.param.ParamsDict` - [ ] `airflow.models.baseoperator.BaseOperator` → `airflow.sdk.bases.operator.BaseOperator` - [ ] `airflow.models.baseoperator.chain` → `airflow.sdk.bases.operator.chain` ### airflow.macros module - [ ] `airflow.macros.*` → `airflow.sdk.execution_time.macros` ### airflow.io module - [ ] `airflow.io.get_fs` → `airflow.sdk.io.get_fs` - [ ] `airflow.io.has_fs` → `airflow.sdk.io.has_fs` - [ ] `airflow.io.attach` → `airflow.sdk.io.attach` - [ ] `airflow.io.Properties` → `airflow.sdk.io.Properties` - [ ] `airflow.io.path.ObjectStoragePath` → `airflow.sdk.ObjectStoragePath` ### airflow.hooks module - [ ] `airflow.hooks.filesystem.FSHook` → `airflow.providers.standard.hooks.filesystem.FSHook` - [ ] `airflow.hooks.base.BaseHook` → `airflow.sdk.bases.hook.BaseHook` ### airflow.decorators module - [ ] `airflow.decorators.dag` → `airflow.sdk.dag` - [ ] `airflow.decorators.task` → `airflow.sdk.task` - [ ] `airflow.decorators.task_group` → `airflow.sdk.task_group` - [ ] `airflow.decorators.base.DecoratedOperator` → `airflow.sdk.bases.decorator.DecoratedOperator` ## Notes - Some imports may have already been done - We can use this as a knowledge base to develop assertion dags that import and validate old vs new paths for better user onboarding - Consider phasing the implementation if the scope is too large ### Committer - [x] I acknowledge that I am a maintainer/committer of the Apache Airflow project. -- 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]
