This is an automated email from the ASF dual-hosted git repository.
amoghrajesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new cfcca0dba46 Export StoreScope from airflow.sdk as public interface
(#73600)
cfcca0dba46 is described below
commit cfcca0dba46da33e5da6dd7fad4e9137e5531d22
Author: Amogh Desai <[email protected]>
AuthorDate: Thu Sep 24 09:35:09 2026 +0530
Export StoreScope from airflow.sdk as public interface (#73600)
---
.../docs/administration-and-deployment/task-and-asset-state-store.rst | 2 +-
.../common/io/src/airflow/providers/common/io/state_store/backend.py | 4 +++-
task-sdk/src/airflow/sdk/state.py | 1 +
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git
a/airflow-core/docs/administration-and-deployment/task-and-asset-state-store.rst
b/airflow-core/docs/administration-and-deployment/task-and-asset-state-store.rst
index b2384e6b8dd..ba26194d4ec 100644
---
a/airflow-core/docs/administration-and-deployment/task-and-asset-state-store.rst
+++
b/airflow-core/docs/administration-and-deployment/task-and-asset-state-store.rst
@@ -124,7 +124,7 @@ Custom backends
A custom backend must subclass :class:`~airflow.sdk.state.BaseStoreBackend`
and implement its abstract methods: ``get``, ``set``, ``delete``, and ``clear``
for synchronous callers and the ``aget``, ``aset``, ``adelete``, and ``aclear``
async equivalents. Refer to :class:`~airflow.sdk.state.BaseStoreBackend` for
the full API.
-Each method receives a ``scope`` argument that is either a
:class:`~airflow.sdk.state.TaskScope` or an
:class:`~airflow.sdk.state.AssetScope`. Use ``isinstance`` to dispatch:
+Each method receives a ``scope`` argument that is either a
:class:`~airflow.sdk.state.TaskScope` or an
:class:`~airflow.sdk.state.AssetScope`. The union of the two is exported as
``airflow.sdk.state.StoreScope`` for type annotations. Use ``isinstance`` to
dispatch:
.. code-block:: python
diff --git
a/providers/common/io/src/airflow/providers/common/io/state_store/backend.py
b/providers/common/io/src/airflow/providers/common/io/state_store/backend.py
index a6b7a690510..f74d0467333 100644
--- a/providers/common/io/src/airflow/providers/common/io/state_store/backend.py
+++ b/providers/common/io/src/airflow/providers/common/io/state_store/backend.py
@@ -33,9 +33,11 @@ if TYPE_CHECKING:
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.orm import Session
+ from airflow.sdk.state import StoreScope
+
from airflow.sdk import ObjectStoragePath
-from airflow.sdk._shared.state import AssetScope, BaseStoreBackend,
StoreScope, TaskScope
+from airflow.sdk.state import AssetScope, BaseStoreBackend, TaskScope
SECTION = "common.io"
diff --git a/task-sdk/src/airflow/sdk/state.py
b/task-sdk/src/airflow/sdk/state.py
index fc2e3d8aa75..228d811f98f 100644
--- a/task-sdk/src/airflow/sdk/state.py
+++ b/task-sdk/src/airflow/sdk/state.py
@@ -21,5 +21,6 @@ from __future__ import annotations
from airflow.sdk._shared.state import (
AssetScope as AssetScope,
BaseStoreBackend as BaseStoreBackend,
+ StoreScope as StoreScope,
TaskScope as TaskScope,
)