FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: export StorageAdapter and get_storage_adapter at top level by dimitri-yatsenko · Pull Request #1463 · datajoint/datajoint-python · GitHub

Repository navigation

feat: export StorageAdapter and get_storage_adapter at top level - #1463

Merged
dimitri-yatsenko merged 1 commit into
masterfrom
feat/export-storage-adapter
Jun 5, 2026
Merged

dimitri-yatsenko merged 1 commit into
masterfrom
feat/export-storage-adapter

Conversation

Copy link
Copy Markdown
Member

Summary

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'

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 in src/datajoint/storage_adapter.py
  • get_storage_adapter(protocol) — lookup helper

The private _discover_adapters helper is intentionally not exported.

Smoke test

python -c "import datajoint as dj; print(dj.StorageAdapter, dj.get_storage_adapter)"
# <class 'datajoint.storage_adapter.StorageAdapter'>
# <function get_storage_adapter at 0x...>

Release target

Candidate for 2.2.4 (alongside #1461 settings.py marker refresh, #1462 packaging dep fix).

Test plan

  • import datajoint as dj; dj.StorageAdapter returns the class
  • dj.get_storage_adapter is callable
  • Pre-commit hooks (ruff, ruff-format, mypy, codespell) pass

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.
dimitri-yatsenko merged commit fedd2ea into master Jun 5, 2026
7 checks passed
dimitri-yatsenko deleted the feat/export-storage-adapter branch June 5, 2026 19:03
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

Labels

enhancement Indicates new improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL