[FR]: Add preview for CSV files
Proposal summary
Context: Opik supports attachments which allow you to log any type of content to a trace or span (see docs).
Today we support viewing many formats to the UI (see docs) but not CSV files.
Implementation: Let's add a way to preview CSV files similarly to how we support some of the other attachment formats.
Motivation
No response
i would like to work on it , can you assign it to me thank you
@jverre @vincentkoc , I would like to work on the issue. Can you please assign this to me.
Hi @jverre! I'd love to take on this CSV preview feature. I've reviewed the attachment documentation and understand how Opik currently handles various formats like images, audio, and text.
My Background:
- 2+ years experience with React/TypeScript frontend development and data visualization
- Built CSV parsing and preview components using libraries like PapaParse and React Table
- Previous Hacktoberfest contributor (2023, 2024) with merged PRs in observability/ML tooling projects
- Familiar with Python backend integration for file handling and MIME type detection
Implementation Approach:
-
Frontend (React):
- Create a
CSVPreviewComponentwith virtualized scrolling for large files (using react-window) - Add column sorting, search/filter capabilities, and configurable row limits (e.g., first 100 rows with "load more")
- Implement responsive table design with proper overflow handling
- Handle edge cases: malformed CSVs, various delimiters (comma, semicolon, tab), quoted fields
- Create a
-
Backend Integration:
- Extend the attachment handler to detect CSV MIME types (
text/csv,application/csv) - Add server-side parsing with size limits to prevent memory issues
- Return structured JSON with column headers and row data
- Extend the attachment handler to detect CSV MIME types (
-
UX Enhancements:
- Loading states and error messages for corrupted files
- Export functionality to download the preview
- Dark mode support matching Opik's existing theme
-
Testing:
- Unit tests for CSV parsing edge cases
- Integration tests for the preview component
- Performance testing with large files (100K+ rows)
I can have a draft PR ready within 3-4 days with comprehensive tests and documentation updates. Happy to discuss the technical approach or adapt based on your preferences!
Looking forward to contributing to Opik! @jverre @juanferrub
Hi @kayush0712,
Go for it, let us know if you need any help - Will assign this issue to you, if you can't get to it let us know so we can re-assign it
thank you @jverre i need 3-4 days because i am new to open source community
mvn clean install getting failed everytime whenever i am trying to run in backend repo
Hey @jverre Can you assign this issue to me?
Hi @jverre !
I'd love to work on this issue to add CSV preview support to Opik.
About me: I'm a final-year CS student with experience in:
- Full-stack development (React, Next.js, TypeScript)
- Building AI/LLM applications with RAG pipelines
- Working with data visualization and file parsing
My approach:
- Study how existing attachment previews work (images, PDFs, etc.)
- Implement CSV parsing using a library like PapaParse
- Create a table component to display CSV data with pagination
- Add proper error handling for malformed CSVs
- Follow existing code patterns and styling
I've already reviewed the codebase structure and the attachment documentation.
Would you be open to assigning this to me? Happy to discuss the implementation approach first if you'd like!
Thanks!
Hi @jverre, please review this PR. Thanks :)