feat: keymap_put / keymap_lookup verbs for the KeyMap primitive - #23
Merged
Conversation
Companion to automators-com/datamaker#2796 (issue #2787): the API now has a first-class KeyMap primitive for old-to-new key mappings during migrations. - KeyMapsClient: get_keymaps, keymap_put (batch upsert, dict of old to new), keymap_lookup (returns mappings + missing), get_keymap_entries, delete_keymap - Delegated on the DataMaker class (dm.keymap_put / dm.keymap_lookup) with a keymaps property for direct access, matching the sets wiring - Unit tests following the existing mock patterns (6 new, all 68 pass) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
AminChirazi
added a commit
that referenced
this pull request
Jul 15, 2026
Ships the KeyMap SDK verbs (dm.keymap_put / dm.keymap_lookup and the KeyMapsClient) added in #23, companion to the API-side KeyMap primitive (automators-com/datamaker#2796). Minor, backward compatible. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Companion to automators-com/datamaker#2796 (issue automators-com/datamaker#2787): the DataMaker API now has a first-class KeyMap primitive that records old-to-new key mappings during migrations. This adds the SDK verbs.
Note: dm.save_set / dm.get_set (the other half named in the issue) already exist in this SDK, so this PR only adds what was missing.
What changed
KeyMapsClient(routes/keymaps.py):keymap_put(map_name, object, entries, run_id=None, project_id=None)- batch upsert;entriesis a dict of old key to new key; same old key written again overwrites its new key; server caps batches at 5000keymap_lookup(map_name, object, old_keys, project_id=None)- batch translate; returnsmappingsplus amissinglistget_keymaps,get_keymap_entries(paginated inspection),delete_keymapDataMakerclass (dm.keymap_put(...),dm.keymap_lookup(...)) with akeymapsproperty for direct access, matching the sets wiringDATAMAKER_PROJECT_ID, as everywhere elseVerification
🤖 Generated with Claude Code