Skip to content

feat(datasets): narrow create to sql/query-id; rename label/table-name#95

Open
eddietejeda wants to merge 7 commits into
mainfrom
feat/datasets-rework
Open

feat(datasets): narrow create to sql/query-id; rename label/table-name#95
eddietejeda wants to merge 7 commits into
mainfrom
feat/datasets-rework

Conversation

@eddietejeda
Copy link
Copy Markdown
Contributor

Summary

  • datasets create now only accepts --sql or --query-id as the data source — --file, --upload-id, --url removed from the CLI (for file uploads, use hotdata databases)
  • Exactly one of --sql or --query-id is required at parse time
  • --name (required) replaces --table-name — the SQL table name the dataset is registered under
  • --description (optional) replaces --label — the human-readable display name
  • Same renames applied to datasets update for consistency
  • Underlying upload/URL functions in datasets.rs are kept but no longer exposed

@sentry
Copy link
Copy Markdown

sentry Bot commented May 22, 2026

Codecov Report

❌ Patch coverage is 0% with 22 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/main.rs 0.00% 12 Missing ⚠️
src/datasets.rs 0.00% 10 Missing ⚠️

📢 Thoughts on this report? Let us know!

Comment thread src/main.rs
Comment thread src/main.rs
Comment thread src/main.rs
Comment thread src/main.rs Outdated
Comment thread src/command.rs Outdated
Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Review

Blocking Issues

  • src/datasets.rs:386create_from_query errors out with error: --label is required when using --sql when description is None. With the new CLI, --description is documented as optional, so the documented happy path (hotdata datasets create --sql "..." --name foo) crashes, and the message references a flag that no longer exists.
  • src/datasets.rs:403 — same issue in create_from_saved_query for the --query-id path.
  • src/datasets.rs:510datasets::update still prints error: provide at least one of --label or --table-name., both of which were renamed in this PR.

Action Required

  • Decide how create_from_query / create_from_saved_query should handle a missing --description (fall back to name, pass through to the API, or make --description required) and update the error messages to reference the new flag names.
  • Update the datasets::update no-fields error message to reference --description / --name.

Non-blocking nits left inline.

eddietejeda and others added 2 commits May 22, 2026 13:23
After the create rework removed --file/--upload-id/--url paths, the upload
infrastructure (FileType, detect_from_bytes/path, stdin_redirect_filename,
make_progress_bar, do_upload, upload_from_file/stdin, create_from_upload,
create_from_url) was left as dead code. Remove it.

Also align create_from_query/create_from_saved_query with the new CLI:
- `name: &str` (required, was Option<&str>)
- `description: Option<&str>` (optional, was required label)
- create_dataset builds the body with table_name always set, label only when provided

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread src/main.rs
Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Review

Blocking Issues

  • src/datasets.rs:218datasets::update still prints error: provide at least one of --label or --table-name., referencing the old flag names. This was flagged in the prior review and remains unfixed. The two other prior blocking issues (create_from_query / create_from_saved_query rejecting None for label) are resolved.

Action Required

  • Update the datasets::update no-fields error message to reference --description and --name.

Comment thread src/main.rs
Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Review

Blocking Issues

  • src/datasets.rs:218datasets::update still prints error: provide at least one of --label or --table-name., referencing the old flag names. Flagged in cycles 1 and 2; still unresolved in this cycle.

Action Required

  • Update the datasets::update no-fields error message to reference --description and --name.

- datasets::update now references --description/--name (not the old
  --label/--table-name flags that were renamed in this PR)
- replace query_id.unwrap() with unreachable!() to make the clap
  invariant explicit rather than silently panicking

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
claude[bot]
claude Bot previously approved these changes May 22, 2026
Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

All blocking issues from prior cycles are resolved. The update() error message now correctly references --description and --name, and the create_from_query/create_from_saved_query paths correctly treat --description as optional.

@eddietejeda
Copy link
Copy Markdown
Contributor Author

@claude review

Without this, omitting --description sent no label to the API, which
treats label as required and would return a server-side error.

Also corrects the --name help text example from a qualified
default.public.my_view to just my_view — the API table_name field
expects an unqualified identifier.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

All prior blocking issues are addressed: create_from_query and create_from_saved_query no longer reject None for description; datasets::update error message at src/datasets.rs:216 now references the new --description / --name flags; query_id is unwrapped via unreachable! to make the clap invariant explicit. LGTM.

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.

1 participant