Skip to content

Commit

Permalink
[OPIK-799] Can't add trace to dataset (#1056)
Browse files Browse the repository at this point in the history
  • Loading branch information
andriidudar authored Jan 16, 2025
1 parent 54b5e52 commit 13d4327
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useCallback, useMemo, useState } from "react";
import get from "lodash/get";
import isObject from "lodash/isObject";
import isUndefined from "lodash/isUndefined";
import { Database, MessageCircleWarning } from "lucide-react";
import { keepPreviousData } from "@tanstack/react-query";

Expand Down Expand Up @@ -63,15 +63,14 @@ const AddToDatasetDialog: React.FunctionComponent<AddToDatasetDialogProps> = ({
const total = data?.total ?? 0;

const validRows = useMemo(() => {
return rows.filter((r) => isObject(r.input));
return rows.filter((r) => !isUndefined(r.input));
}, [rows]);

const noValidRows = validRows.length === 0;
const partialValid = validRows.length !== rows.length;

const addToDatasetHandler = useCallback(
(dataset: Dataset) => {
console.log(123, dataset);
setOpen(false);
datasetItemBatchMutation.mutate(
{
Expand Down

0 comments on commit 13d4327

Please sign in to comment.