Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

chore(csv-upload): reduce min chunk size (#5496)

marliessophie9d37cc4d3413
diff --git a/web/src/features/datasets/components/PreviewCsvImport.tsx b/web/src/features/datasets/components/PreviewCsvImport.tsx
index 22a9a6c5de..168847cd00 100644
--- a/web/src/features/datasets/components/PreviewCsvImport.tsx
+++ b/web/src/features/datasets/components/PreviewCsvImport.tsx
@@ -23,7 +23,8 @@ import { MAX_FILE_SIZE_BYTES } from "@/src/features/datasets/components/UploadDa
import { Progress } from "@/src/components/ui/progress";
import { usePostHogClientCapture } from "@/src/features/posthog-analytics/usePostHogClientCapture";
-const MIN_CHUNK_SIZE = 50;
+const MIN_CHUNK_SIZE = 1;
+const CHUNK_START_SIZE = 50;
const DELAY_BETWEEN_CHUNKS = 100; // milliseconds
// Max payload size is 1MB, but we must account for any trpc wrapper data and context
@@ -276,7 +277,7 @@ export function PreviewCsvImport({
},
});
- const optimalChunkSize = getOptimalChunkSize(items, MIN_CHUNK_SIZE);
+ const optimalChunkSize = getOptimalChunkSize(items, CHUNK_START_SIZE);
const chunks = chunkArray(items, optimalChunkSize);
for (const [index, chunk] of chunks.entries()) {