feat: export StorageAdapter and get_storage_adapter at top level#1463
Merged
Conversation
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.
4 tasks
ttngu207
approved these changes
Jun 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Storage Adapter spec (datajoint-docs#172) documents
dj.StorageAdapteras the public base class anddj.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:Surfaced by Milagros in her review of #172 (item #1).
Fix
Adds the two public symbols to
src/datajoint/__init__.py(both__all__and the import line):StorageAdapter— ABC defined insrc/datajoint/storage_adapter.pyget_storage_adapter(protocol)— lookup helperThe private
_discover_adaptershelper is intentionally not exported.Smoke test
Release target
Candidate for 2.2.4 (alongside #1461 settings.py marker refresh, #1462 packaging dep fix).
Test plan
import datajoint as dj; dj.StorageAdapterreturns the classdj.get_storage_adapteris callable