From 6ff3d056baf29a92f762641e5da5b2a2a438db70 Mon Sep 17 00:00:00 2001 From: brimoor Date: Fri, 15 Nov 2024 00:09:55 -0500 Subject: [PATCH] fix target view for clear sample/frame field operators --- fiftyone/operators/builtin.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fiftyone/operators/builtin.py b/fiftyone/operators/builtin.py index 70effa2247..6ccc777235 100644 --- a/fiftyone/operators/builtin.py +++ b/fiftyone/operators/builtin.py @@ -622,8 +622,11 @@ def resolve_input(self, ctx): def execute(self, ctx): field_name = ctx.params["field_name"] + target = ctx.params.get("target", None) + + target_view = _get_target_view(ctx, target) - ctx.dataset.clear_sample_field(field_name) + target_view.clear_sample_field(field_name) ctx.trigger("reload_dataset") @@ -713,8 +716,11 @@ def resolve_input(self, ctx): def execute(self, ctx): field_name = ctx.params["field_name"] + target = ctx.params.get("target", None) + + target_view = _get_target_view(ctx, target) - ctx.dataset.clear_frame_field(field_name) + target_view.clear_frame_field(field_name) ctx.trigger("reload_dataset")