amoghrajesh commented on code in PR #53389: URL: https://github.com/apache/airflow/pull/53389#discussion_r2273788715
########## airflow-core/src/airflow/example_dags/example_latest_only_with_trigger.py: ########## @@ -29,7 +29,12 @@ from airflow.providers.standard.operators.empty import EmptyOperator from airflow.providers.standard.operators.latest_only import LatestOnlyOperator from airflow.sdk import DAG -from airflow.utils.trigger_rule import TriggerRule + +try: + from airflow.sdk import TriggerRule +except ImportError: + # Compatibility for Airflow < 3.1 + from airflow.utils.trigger_rule import TriggerRule # type: ignore[no-redef,attr-defined] Review Comment: Oh wait, this is core example dags, we shouldnt need compat there, but we should be maintaining compat for example provider dags? I was suggesting we maintain back-compat for providers, people can copy dags from the providers docs once released and try to use it with < 3.1 airlfow. Conditional imports could help for provider example DAGs, but aren’t needed for core. -- 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]
