Skip to content

Add create_dataset CLI command - #732

Open
hippi345 wants to merge 2 commits into
DagsHub:mainfrom
hippi345:cursor/create-dataset-cli-b8a1
Open

hippi345 wants to merge 2 commits into
DagsHub:mainfrom
hippi345:cursor/create-dataset-cli-b8a1

Conversation

@hippi345

Copy link
Copy Markdown

Exposes the existing dagshub.upload.create_dataset helper as a CLI command, so users can create a repo and upload a local dataset folder without writing Python.

  • Adds dagshub create_dataset REPO_NAME LOCAL_PATH with --glob-exclude, --org-name, --private and --host
  • Adds CLI unit tests with a mocked backend (2 passing). flake8 is clean on the changed files.

Closes #244

Expose the existing upload.create_dataset helper via the dagshub CLI
with options for org name, glob exclude, and private repos.
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4b182052-9a9b-41fa-beaa-7f888dca8396
Commits

Reviewing files that changed from the base of the PR and between 0e592ce and 9fe466f.

Files selected for processing: 1
  • dagshub/common/cli.py
Files skipped from review as they are similar to previous changes: 1
  • dagshub/common/cli.py

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Recent review details
Context from checks skipped due to timeout: 1
  • GitHub Check: CodeRabbit
Walkthrough

The CLI now provides a create_dataset command that creates a dataset repository from an existing local directory. Tests verify option forwarding and rejection of a nonexistent directory.

Changes: Dataset CLI

Layer / File(s) Summary
Register and validate dataset creation command
dagshub/common/cli.py, tests/common/test_cli_create_dataset.py
The CLI accepts a repository name, local directory, and creation options, then calls create_dataset and logs the repository address. Tests check the forwarded arguments and nonexistent-directory handling.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: kbolashev

Merge Risk: Minimal · up to 9fe46

The command’s host handling and dataset creation delegation are consistent with the existing behavior. No identified issue prevents merging after normal checks.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title "Add create_dataset CLI command" matches the main change. The changeset adds a create_dataset CLI command in dagshub/common/cli.py that exposes the existing `dagshub.upload.create_datase…
Description check Passed The description states that the change exposes the existing dagshub.upload.create_dataset helper as a CLI command. It lists the command syntax, the --glob-exclude, --org-name, --private, and `…
Linked Issues check Passed The changes satisfy issue #244. dagshub/common/cli.py registers dagshub create_dataset with repository and existing-directory arguments. It exposes --glob-exclude, --org-name, --private, and…
Out of Scope Changes check Passed The diff contains the CLI command, the public create_dataset import, and focused CLI tests. Each change supports issue #244. No unrelated product behavior or files appear in the reviewed diff.
Full details: Title check

Explanation

The title "Add create_dataset CLI command" matches the main change. The changeset adds a create_dataset CLI command in dagshub/common/cli.py that exposes the existing dagshub.upload.create_dataset helper. The title is short, specific, and names the primary change.

Full details: Description check

Explanation

The description states that the change exposes the existing dagshub.upload.create_dataset helper as a CLI command. It lists the command syntax, the --glob-exclude, --org-name, --private, and --host options, and the added CLI unit tests. It matches the changeset.

Full details: Linked Issues check

Explanation

The changes satisfy issue #244. dagshub/common/cli.py registers dagshub create_dataset with repository and existing-directory arguments. It exposes --glob-exclude, --org-name, --private, and --host. It applies CLI settings and calls dagshub.upload.create_dataset with the dataset arguments. tests/common/test_cli_create_dataset.py covers argument forwarding and invalid directory handling.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit taps the command with care
A dataset starts from files laid there
Options pass along the way
Missing paths are turned away
The repo address joins the day

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f04b2933-6e6d-416b-b2e8-8fac1325e1cd
Commits

Reviewing files that changed from the base of the PR and between 4f7d78a and 0e592ce.

Files selected for processing: 2
  • dagshub/common/cli.py
  • tests/common/test_cli_create_dataset.py

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Review details
Context from checks skipped due to timeout: 1
  • GitHub Check: CodeRabbit

Comment thread dagshub/common/cli.py Resolved
Normalize command-level --host values so token lookup matches cached
credentials when a trailing slash is provided.
@hippi345

Copy link
Copy Markdown
Author

good catch, switched to config.set_host() so --host gets normalized like everywhere else.

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.

Support create_dataset as CLI

1 participant