From 237bc1416da75c8c2c975a917acd614195f48d9f Mon Sep 17 00:00:00 2001 From: Nick Tobey Date: Wed, 3 Jul 2024 11:24:33 -0700 Subject: [PATCH] Update uses of MutableJSON::Set and MutableJSON::Replace to use context. --- go/libraries/doltcore/merge/merge_prolly_rows.go | 2 +- go/store/prolly/tree/json_indexed_document.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go/libraries/doltcore/merge/merge_prolly_rows.go b/go/libraries/doltcore/merge/merge_prolly_rows.go index c8ee57ce73e..39eaa2d8db4 100644 --- a/go/libraries/doltcore/merge/merge_prolly_rows.go +++ b/go/libraries/doltcore/merge/merge_prolly_rows.go @@ -2053,7 +2053,7 @@ func mergeJSON(ctx context.Context, base types.JSONDocument, left types.JSONDocu switch threeWayDiff.Op { case tree.DiffOpRightAdd, tree.DiffOpConvergentAdd, tree.DiffOpRightModify, tree.DiffOpConvergentModify: - _, _, err := merged.Set(threeWayDiff.Key, threeWayDiff.Right) + _, _, err := merged.Set(ctx, threeWayDiff.Key, threeWayDiff.Right) if err != nil { return types.JSONDocument{}, true, err } diff --git a/go/store/prolly/tree/json_indexed_document.go b/go/store/prolly/tree/json_indexed_document.go index 65295f3c413..065f18ed33f 100644 --- a/go/store/prolly/tree/json_indexed_document.go +++ b/go/store/prolly/tree/json_indexed_document.go @@ -323,21 +323,21 @@ func (i IndexedJsonDocument) Remove(ctx context.Context, path string) (types.Mut } // Set is not yet implemented, so we call it on a types.JSONDocument instead. -func (i IndexedJsonDocument) Set(path string, val sql.JSONWrapper) (types.MutableJSON, bool, error) { +func (i IndexedJsonDocument) Set(ctx context.Context, path string, val sql.JSONWrapper) (types.MutableJSON, bool, error) { v, err := i.ToInterface() if err != nil { return nil, false, err } - return types.JSONDocument{Val: v}.Set(path, val) + return types.JSONDocument{Val: v}.Set(ctx, path, val) } // Replace is not yet implemented, so we call it on a types.JSONDocument instead. -func (i IndexedJsonDocument) Replace(path string, val sql.JSONWrapper) (types.MutableJSON, bool, error) { +func (i IndexedJsonDocument) Replace(ctx context.Context, path string, val sql.JSONWrapper) (types.MutableJSON, bool, error) { v, err := i.ToInterface() if err != nil { return nil, false, err } - return types.JSONDocument{Val: v}.Replace(path, val) + return types.JSONDocument{Val: v}.Replace(ctx, path, val) } // ArrayInsert is not yet implemented, so we call it on a types.JSONDocument instead.