Merge parameter data updates#225
Open
john (j13huang) wants to merge 4 commits into
Open
Conversation
|
Latest downloadable build artifacts for this PR commit
Available artifact names
|
Abhijeet Prasad (AbhiPrasad)
requested changes
Jun 4, 2026
Comment on lines
+739
to
+753
| Value::Array( | ||
| [ | ||
| PARAMETER_SCHEMA_MERGE_PATH.as_slice(), | ||
| PARAMETER_METADATA_MERGE_PATH.as_slice(), | ||
| ] | ||
| .into_iter() | ||
| .map(|path| { | ||
| Value::Array( | ||
| path.iter() | ||
| .map(|component| Value::String((*component).to_string())) | ||
| .collect(), | ||
| ) | ||
| }) | ||
| .collect(), | ||
| ), |
There was a problem hiding this comment.
you should be able to use the json! macro here instead of constructing via Value::Array.
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.
bt functions pushcurrently always replaces the underlying function data for parameters, so pushing a new set of parameters overwrites any manual updates that have been made to the parameter data.This PR makes it so that fields are updated via merge semantics. I'm also planning on reverting this behavior in the sdk
https://github.com/braintrustdata/braintrust-sdk-javascript/pull/1363/files#diff-dc987ecde17ce424aeab43639ec1262c84c53976bdd7f644c8b8b1627c5eb0f3R629
so that by default,
bt functions pushonly updates the schema. Future work will be adding some API surface area for the user to update the underlying saved parameter values themselves (braintrustdata/braintrust-sdk-javascript#2094)