feat(studio): Split file into training set in DD details - #855
Conversation
|
This change is part of the following stack: Change managed by git-spice. |
📝 WalkthroughWalkthroughChangesThe dataset details route adds a file-splitting modal with selectable source files, full-content loading, and error handling. Split uploads normalize output filenames by source format. File editor headers support custom filename slots, and split controls use compact sliders. Dataset splitting and editor integration
Sequence Diagram(s)sequenceDiagram
participant DataDesignerJobDetailsRoute
participant CreateFileSplitsModal
participant useDatasetFileContent
DataDesignerJobDetailsRoute->>CreateFileSplitsModal: Open with datasetId and fileOptions
CreateFileSplitsModal->>useDatasetFileContent: Request full file content
useDatasetFileContent-->>CreateFileSplitsModal: Return content, loading state, or error
CreateFileSplitsModal-->>DataDesignerJobDetailsRoute: Render split form state
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
web/packages/studio/src/components/LeftTruncatedText/index.tsx (1)
4-6: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse a type-only React import.
ComponentPropsandFCare types.Proposed fix
- import { ComponentProps, FC } from 'react'; + import type { ComponentProps, FC } from 'react';As per coding guidelines, use
import typefor type-only imports in TypeScript.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/packages/studio/src/components/LeftTruncatedText/index.tsx` around lines 4 - 6, Update the React import in the component to use a type-only import for ComponentProps and FC, while keeping the runtime Text and cn imports unchanged.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@web/packages/studio/src/api/datasets/useSplitDatasetFile.ts`:
- Around line 58-61: Normalize filepath casing before the isJson extension check
in the output-name construction, so .json and .JSON paths both select JSON
serialization and the .json extension. Keep sourceName, baseName, and non-JSON
behavior unchanged.
In `@web/packages/studio/src/components/FileRowEditor/FileHeader.tsx`:
- Line 71: Update the FileSpreadsheet icon in FileHeader to use a 20px size via
size={20} or the equivalent size-5 utility, so it fits within the surrounding
size-10 badge.
In `@web/packages/studio/src/routes/DataDesignerJobDetailsRoute/index.tsx`:
- Around line 49-53: Update the splitFileOptions derivation in
DataDesignerJobDetailsRoute to filter files through the existing supported
dataset-input condition before mapping their paths. Derive canSplit from this
filtered list so Split is enabled only when at least one valid source file
exists.
---
Nitpick comments:
In `@web/packages/studio/src/components/LeftTruncatedText/index.tsx`:
- Around line 4-6: Update the React import in the component to use a type-only
import for ComponentProps and FC, while keeping the runtime Text and cn imports
unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 028b86b3-5adf-4d7a-ba6b-9b045c4a11ac
📒 Files selected for processing (9)
web/packages/studio/src/api/datasets/useSplitDatasetFile.tsweb/packages/studio/src/components/DataDesignerJobActionsMenu/index.tsxweb/packages/studio/src/components/FileRowEditor/FileHeader.tsxweb/packages/studio/src/components/FileRowEditor/index.tsxweb/packages/studio/src/components/FilesTable/CreateFileSplitsModal/FileSplitsSliders/index.tsxweb/packages/studio/src/components/FilesTable/CreateFileSplitsModal/index.tsxweb/packages/studio/src/components/LeftTruncatedText/index.tsxweb/packages/studio/src/routes/DataDesignerJobDetailsRoute/JobDatasetEditorSection.tsxweb/packages/studio/src/routes/DataDesignerJobDetailsRoute/index.tsx
|
Signed-off-by: Sean Teramae <steramae@nvidia.com>
Signed-off-by: Sean Teramae <steramae@nvidia.com>
36432ff to
7a4028a
Compare
feat(studio): Split file into training set in DD details
Signed-off-by: Sean Teramae steramae@nvidia.com
fix lint
Signed-off-by: Sean Teramae steramae@nvidia.com
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Improvements
.json/.jsonloutput names per split.slotFileNameand improved long-name rendering with left-side truncation.