Skip to content

Commit

Permalink
start enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
Br2850 committed Nov 18, 2024
1 parent 9a13da7 commit 6ac0068
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const OperatorExecutionButton = ({
operatorUri,
onSuccess,
onError,
onClick,
executionParams,
onOptionSelected,
disabled,
Expand All @@ -30,6 +31,7 @@ export const OperatorExecutionButton = ({
operatorUri: string;
onSuccess?: ExecutionCallback;
onError?: ExecutionErrorCallback;
onClick?: () => void;
executionParams?: object;
onOptionSelected?: (option: OperatorExecutionOption) => void;
disabled?: boolean;
Expand All @@ -38,6 +40,7 @@ export const OperatorExecutionButton = ({
return (
<OperatorExecutionTrigger
operatorUri={operatorUri}
onClick={onClick}
onSuccess={onSuccess}
onError={onError}
executionParams={executionParams}
Expand Down
7 changes: 5 additions & 2 deletions fiftyone/operators/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1400,9 +1400,12 @@ class OperatorExecutionButtonView(Button):
"""

def __init__(self, **kwargs):
if "operator" not in kwargs or not isinstance(kwargs["operator"], str):
if "operator" not in kwargs or (
not isinstance(kwargs["operator"], str)
and not callable(kwargs["operator"])
):
raise ValueError(
"The 'operator' parameter of type str is required."
"The 'operator' parameter of type str or callable is required."
)
super().__init__(**kwargs)

Expand Down

0 comments on commit 6ac0068

Please sign in to comment.