Skip to content

fix: validate dataset name and columns before submission#122

Open
balasiddarthan22 wants to merge 1 commit into
tinyfish-io:mainfrom
balasiddarthan22:fix/validate-dataset-form-v2
Open

fix: validate dataset name and columns before submission#122
balasiddarthan22 wants to merge 1 commit into
tinyfish-io:mainfrom
balasiddarthan22:fix/validate-dataset-form-v2

Conversation

@balasiddarthan22

Copy link
Copy Markdown

Submitting with an empty name or zero columns reached the backend and returned a cryptic 'Invalid request' error. Now caught on the client with a clear message before the API call is made.

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 327fd992-90e2-42e1-a2f5-b2c6708a2128

📥 Commits

Reviewing files that changed from the base of the PR and between a82709d and e135f7b.

📒 Files selected for processing (1)
  • frontend/app/dataset/new/page.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/app/dataset/new/page.tsx

📝 Walkthrough

Walkthrough

This PR adds pre-flight validation to the dataset creation flow. When a user clicks "Confirm" to create a dataset, the handleConfirm function now checks that the dataset name is not empty and that at least one column has been defined. If either check fails, the function displays an error message and returns early without attempting to call the backend mutation. The changes are localized to the event handler and do not modify the component's state management or API contract.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: adding validation for dataset name and columns before submission.
Description check ✅ Passed The description clearly explains the problem (empty name/columns reaching backend with cryptic error) and the solution (client-side validation with clear messages).
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@simantak-dabhade simantak-dabhade left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. The client-side validation is a good UX improvement and these checks make sense.

One small extra thing you could fix while you’re here: the validation uses datasetName.trim(), but the mutation still sends the original datasetName, so a name with leading/trailing whitespace would be saved as-is. It would be cleaner to compute a trimmed name once and send that through.

Also, GitHub is showing this PR has a merge conflict / is dirty against main. Could you rebase or otherwise resolve that conflict?

Submitting with an empty name or zero columns reached the backend
and returned a cryptic 'Invalid request' error. Now caught on the
client with a clear message before the API call is made.
@balasiddarthan22 balasiddarthan22 force-pushed the fix/validate-dataset-form-v2 branch from a82709d to e135f7b Compare June 6, 2026 14:38
@balasiddarthan22

Copy link
Copy Markdown
Author

Thanks for the feedback! I've updated the PR to compute trimmedDatasetName = datasetName.trim() once at the top and send that through to the mutation instead of the raw value. I've also rebased onto main to clear the merge conflict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants