Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@
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"

Expand Down
1 change: 1 addition & 0 deletions task-sdk/src/airflow/sdk/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
from airflow.sdk._shared.state import (
AssetScope as AssetScope,
BaseStoreBackend as BaseStoreBackend,
StoreScope as StoreScope,
TaskScope as TaskScope,
)
Loading