Teach the codec context argument as part of the signature - #290
Open
dimitri-yatsenko wants to merge 1 commit into
Open
dimitri-yatsenko wants to merge 1 commit into
dimitri-yatsenko wants to merge 1 commit into
Conversation
Every documented codec signature now declares `context`, so a codec written from these pages is ready for 2.4, when the compatibility code that reads connection context out of the `key` dict is removed (datajoint-python#1557). - codec-api.md gains a section on `context`: what the four keys mean, why threading `config` into _build_path/_get_backend is a correctness matter rather than a style one, and a two-line migration for an existing codec. The pre-2.3.4 form is marked deprecated with its removal release named. - create-custom-codec.md, custom-codecs.md and the custom-codecs tutorial carry the same signature throughout — 29 encode and 28 decode examples across the four pages, plus the `_extract_context` and `_codec_config` call sites that go with them. The two notebook cells hold no outputs, so nothing needs re-executing.
dimitri-yatsenko
requested review from
MilagrosMarin,
lum-agilyti and
ttngu207
September 30, 2026 22:17
This branch has not been deployed
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.
Documents the
contextargument added in datajoint/datajoint-python#1556, and teaches it as the signature rather than an option — so a codec written from these pages needs no change when the compatibility code is removed in 2.4 (datajoint/datajoint-python#1557).Why now rather than at 2.4
The backward-compatible path is what makes 2.3.4 safe to ship, but it is not what anyone should be writing against. Two third-party codecs —
dj-figpack-codecs#6anddj-canvasxpress-codecs#3— shipped the silent-wrong-store bug by copying the documented example, so the example is the thing that most needs to be right.Changes
reference/specs/codec-api.md— a new section oncontext: what the four keys carry, and why threadingconfiginto_build_path()/_get_backend()is a correctness matter rather than a style one (both fall back to the globaldj.configwithout it, which in a multi-connection process belongs to no one and resolves a different store silently instead of raising). The pre-2.3.4 form is marked deprecated with its removal release named, and a two-line migration is given.how-to/create-custom-codec.md,explanation/custom-codecs.md,tutorials/advanced/custom-codecs.ipynb— the same signature throughout: 29encodeand 28decodeexamples across the four pages, plus the_extract_context(key, context)and_codec_config(key, context)call sites that go with them.Verification
mkdocs build --strictclean,check_links.pypasses across 142 pages,check_notebook_versions.pyclean.The two notebook code cells carry no outputs, verified programmatically against
HEAD, so nothing needs re-executing.Ordering
Independent of #288 and #289 — different files, no overlap. Safe to merge in any order, though the behavior it describes only exists once datajoint/datajoint-python#1556 lands.