fix: DatasetCase.metadata() always empty when fetching dataset rows from Braintrust#126
Merged
Andrew Kent (realark) merged 1 commit intoJun 18, 2026
Conversation
InsertProjectLogsEventMetadata extends HashMap<String,Object> and also declares a separate additionalProperties field. Jackson deserializes unknown properties (all custom metadata keys) into the HashMap base, not into the additionalProperties field. DatasetBrainstoreImpl called metadataObj.getAdditionalProperties(), which is always empty, so DatasetCase.metadata() returned an empty map for every row fetched from Braintrust. Fix: copy entries from the HashMap base via new HashMap<>(metadataObj).
1b6da23 to
372f9bb
Compare
Collaborator
|
thanks for flagging this James Kennedy (@Planview-JamesK) , I'll get this merged and released tomorrow |
Andrew Kent (realark)
approved these changes
Jun 18, 2026
12626c9
into
braintrustdata:main
0 of 2 checks passed
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.
Fixes #125
Problem
When running a remote eval that fetches dataset rows from Braintrust (e.g. a dataset assigned in the Playground UI),
DatasetCase.metadata()returns an empty map for every row — even though the rows have metadata set. The same experiment works correctly with the TypeScript CLI.Root Cause
InsertProjectLogsEventMetadataextendsHashMap<String, Object>and also declares a separateadditionalPropertiesfield. Jackson deserializes unknown properties (all custom metadata keys) into theHashMapbase, not into theadditionalPropertiesfield.DatasetBrainstoreImplwas callingmetadataObj.getAdditionalProperties(), which is always empty.Fix
Copy entries from the
HashMapbase vianew HashMap<>(metadataObj)instead of callinggetAdditionalProperties().Verification
Confirmed by running a playground experiment against a Braintrust dataset with metadata fields. After the fix,
DatasetCase.metadata()correctly returns the row's metadata keys. Before the fix,metadata_keys=[]for every dataset-fetched row.