From f0b50ec12a486db6bbf97e40d171b40d9f171827 Mon Sep 17 00:00:00 2001 From: Dimitri Yatsenko Date: Fri, 5 Jun 2026 13:29:34 -0500 Subject: [PATCH] feat: export StorageAdapter and get_storage_adapter at top level MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Storage Adapter spec (datajoint-docs#172) documents ``dj.StorageAdapter`` as the public base class and ``dj.get_storage_adapter()`` as the lookup helper, but they were not exposed via the top-level namespace in 2.2.3 — plugin authors following the spec literally hit ``AttributeError: module 'datajoint' has no attribute 'StorageAdapter'``. Adds the two public symbols to ``__init__.py``: - ``StorageAdapter`` (ABC, defined in ``src/datajoint/storage_adapter.py``) - ``get_storage_adapter(protocol)`` The private ``_discover_adapters`` helper is intentionally not exported. --- src/datajoint/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/datajoint/__init__.py b/src/datajoint/__init__.py index b1dba84e1..4970b19d4 100644 --- a/src/datajoint/__init__.py +++ b/src/datajoint/__init__.py @@ -51,6 +51,9 @@ "get_codec", "ObjectRef", "NpyRef", + # Storage Adapter API + "StorageAdapter", + "get_storage_adapter", # Other "errors", "migrate", @@ -82,6 +85,7 @@ from .instance import Instance, _ConfigProxy, _get_singleton_connection, _global_config, _check_thread_safe from .logging import logger from .objectref import ObjectRef +from .storage_adapter import StorageAdapter, get_storage_adapter from .schemas import _Schema, VirtualModule, list_schemas, virtual_schema from .autopopulate import AutoPopulate from .jobs import Job