You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "jroachgolf84 (via GitHub)" <gi...@apache.org> on 2026/09/02 03:55:55 UTC
[I] Replace airflow.utils.state import with airflow.sdk in opensearch [airflow]
jroachgolf84 opened a new issue, #72409:
URL: https://github.com/apache/airflow/issues/72409
## Description
> This is an issue that is reserved for the Airflow Summit "Contributors" Workshop. This is denoted with the label `contributors-workshop`. Out of respect for the organizers and participants of this workshop, **please do not implement a PR that addresses this issue.**
>
> If this issue is still open following Airflow Summit, the label will be removed and the issue can be picked up.
Sub-issue of #62063, which investigates provider usage of `airflow.utils` imports so they can be replaced with Task SDK equivalents and reduce the `airflow-core` dependency in providers.
| | |
| --- | --- |
| Provider | opensearch |
| Import | `TaskInstanceState` from `airflow.utils.state` |
| Replacement | `airflow.sdk.TaskInstanceState` |
| Shape | Import-only change in a single file |
opensearch requires `apache-airflow>=3.0.0` (see `providers/opensearch/pyproject.toml`), so `airflow.sdk` is always available and no version guard is needed here, unlike most other providers that still support Airflow 2.11+. `airflow.sdk.TaskInstanceState` and `airflow.utils.state.TaskInstanceState` are two independently defined `(str, Enum)` classes with matching member names and string values, so this is a plain import swap with no behavior change.
### What needs to change
Replace `from airflow.utils.state import TaskInstanceState` with `from airflow.sdk import TaskInstanceState` in:
- `providers/opensearch/src/airflow/providers/opensearch/log/os_task_handler.py:53`, used later in the file at `ti.state in (TaskInstanceState.RUNNING, TaskInstanceState.DEFERRED)`
No other code in this file needs to change, only the import line.
### How to verify it
The existing unit tests should pass unmodified, since the enum values are identical:
```bash
breeze testing providers-tests providers/opensearch/tests/unit/opensearch/log/test_os_task_handler.py
```
## Definition of Done
1. Update the import in `log/os_task_handler.py`.
2. Confirm no other `airflow.utils.state` usage remains in `providers/opensearch/src` (`grep -rn "airflow.utils.state" providers/opensearch/src`).
3. No new tests are needed, this is a like-for-like import swap, existing tests should pass unmodified.
4. This should pass:
```bash
breeze testing providers-tests --test-type "Providers[opensearch]"
```
---
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: commits-unsubscribe@airflow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Replace `airflow.utils.state` import with `airflow.sdk` in OpenSearch Provider [airflow]
Posted by "atamagrawal (via GitHub)" <gi...@apache.org>.
atamagrawal commented on issue #72409:
URL: https://github.com/apache/airflow/issues/72409#issuecomment-5512312183
@jroachgolf84 Can I work on it?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Replace `airflow.utils.state` import with `airflow.sdk` in OpenSearch Provider [airflow]
Posted by "kaxil (via GitHub)" <gi...@apache.org>.
kaxil closed issue #72409: Replace `airflow.utils.state` import with `airflow.sdk` in OpenSearch Provider
URL: https://github.com/apache/airflow/issues/72409
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Replace airflow.utils.state import with airflow.sdk in opensearch [airflow]
Posted by "jroachgolf84 (via GitHub)" <gi...@apache.org>.
jroachgolf84 commented on issue #72409:
URL: https://github.com/apache/airflow/issues/72409#issuecomment-5504153992
This is an issue that is reserved for the Airflow Summit "Contributors" Workshop. This is denoted with the label `contributors-workshop`. Out of respect for the organizers and participants of this workshop, **please do not implement a PR that addresses this issue.**
If this issue is still open following Airflow Summit, the label will be removed and the issue can be picked up.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org