jroachgolf84 commented on issue #62063:
URL: https://github.com/apache/airflow/issues/62063#issuecomment-5504232447

   ### Status update: Task SDK equivalents for `airflow.utils` imports
   
   Four issues have been opened so far for the straightforward cases, providers 
that already require `apache-airflow>=3.0.0`, so the swap needs no version 
guard. All four replace `TaskInstanceState`/`DagRunState` from 
`airflow.utils.state` with the `airflow.sdk` equivalent as a plain import swap:
   
   - edge3: #72408
   - opensearch: #72409
   - common.ai: #72410
   - informatica: #72411
   
   Outstanding work is grouped below by the kind of change needed.
   
   #### 1. `TaskInstanceState`/`DagRunState` swap, providers still supporting 
`apache-airflow>=2.11.0`
   
   Same replacement, but these providers still support Airflow 2.11+, where 
`airflow.sdk` does not exist, so each needs a version guard (`if 
AIRFLOW_V_3_0_PLUS: from airflow.sdk import ... else: from airflow.utils.state 
import ...`) rather than a bare swap. Most of these files already import an 
`AIRFLOW_V_3_0_PLUS`-style flag from the provider's own `version_compat.py`, so 
the guard is a small addition, not new plumbing.
   
   - amazon: `aws/sensors/mwaa.py`, `aws/triggers/emr.py`, 
`aws/triggers/mwaa.py`
   - google: `cloud/triggers/dataproc.py`, `cloud/triggers/bigquery.py`, 
`cloud/sensors/cloud_composer.py`
   - cncf.kubernetes: `triggers/pod.py`, `executors/kubernetes_executor.py`, 
`executors/kubernetes_executor_utils.py`, 
`executors/kubernetes_executor_types.py` (already `TYPE_CHECKING` only, safe as 
a bare swap)
   - databricks: `plugins/databricks_workflow.py`
   - standard: `sensors/external_task.py`, `operators/trigger_dagrun.py`, 
`triggers/external_task.py` (already `TYPE_CHECKING` only, safe as a bare swap)
   - openlineage: `plugins/adapter.py` (already `TYPE_CHECKING` only), 
`plugins/listener.py`, `api/datasets.py`, `utils/utils.py` (already 
`TYPE_CHECKING` only), `extractors/manager.py`
   - celery: `executors/celery_executor.py`
   - elasticsearch: `log/es_task_handler.py`
   - apache.kafka: `plugins/event_producer.py` (already `TYPE_CHECKING` only, 
safe as a bare swap)
   
   22 files across 9 providers.
   
   #### 2. `determine_kwargs` swap
   
   `from airflow.utils.operator_helpers import determine_kwargs` to `from 
airflow.sdk.bases.decorator import determine_kwargs`. 
`airflow.utils.operator_helpers.determine_kwargs` is already a deprecated 
re-export pointing at this exact sdk function, so the swap itself is low risk, 
but standard and http both still support Airflow 2.11+ and need the same 
version guard treatment as group 1.
   
   - standard: `sensors/python.py`
   - http: `sensors/http.py`, `operators/http.py`
   
   3 files across 2 providers.
   
   #### Out of scope for a direct swap
   
   The remaining `airflow.utils` imports found across providers (`helpers`, 
`strings`, `hashlib_wrapper`, `platform`, `cli`, `db`/`session`, log serving 
handlers, `deprecation_tools`, `process_utils`) have no existing `airflow.sdk` 
equivalent to swap to. Addressing those means inlining the logic as private 
provider code instead, a separate effort from the workshop sized import swaps 
above.
   
   ---
   Drafted-by: Claude Code (Sonnet 5) (no human review before posting)
   


-- 
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]

Reply via email to