Skip to content

fix: address CLI UX feedback — file input, region hints, comment handling - #12

Merged
rahim-bhojani merged 2 commits into
mainfrom
fix/cli-ux-feedback
Apr 7, 2026
Merged

rahim-bhojani merged 2 commits into
mainfrom
fix/cli-ux-feedback

Conversation

@rahim-bhojani

Copy link
Copy Markdown
Contributor

Summary

Addresses CLI feedback from a marketing data engineer building a semantic layer with Dremio Cloud EU + Claude Code:

  • --file and stdin support for dremio query run — Multi-line SQL (CREATE VIEW, CTEs) no longer requires shell escaping. Supports --file query.sql, piped stdin, and dremio query run - for reading from stdin.
  • 401 region hint for EU users — When a 401 comes from the default US endpoint (api.dremio.cloud), the error now suggests checking the EU endpoint. Previously took ~45 min to diagnose.
  • Fix -- SQL comments being swallowed — The breadcrumb comment (/* dremio-cli: submitter=cli */) is now on its own line, so -- inline comments in user SQL no longer comment out the rest of the query.
  • Config path in dremio setup --help — Help text now shows where the config file is written and that region (US/EU) is prompted.

Test plan

  • dremio query run "SELECT 1" — inline arg still works
  • dremio query run --file query.sql — reads and executes SQL from file
  • echo "SELECT 1" | dremio query run - — reads from stdin
  • dremio query run with no args — shows helpful error
  • dremio query run --file missing.sql — shows file-not-found error
  • dremio query run "-- comment\nSELECT 1" — comment doesn't break query
  • Verify 401 against US endpoint includes EU region hint in error message
  • dremio setup --help shows config file path and region info

🤖 Generated with Claude Code

…ling

- Add --file flag and stdin support to `dremio query run` so multi-line
  SQL no longer requires shell escaping (supports --file path, piped
  stdin, and '-' argument)
- Enrich 401 errors with a region hint when the default US endpoint is
  used, saving EU users from a confusing debugging loop
- Put breadcrumb comment on its own line so SQL with -- inline comments
  is no longer swallowed by the prepended comment
- Show config file path and region info in `dremio setup --help`

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 02ada65efa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/drs/commands/query.py Outdated
Comment thread src/drs/commands/query.py Outdated
Comment thread src/drs/commands/query.py
Address review feedback: leverage typer's exists/file_okay/dir_okay/
readable/allow_dash options instead of manual checks. This gives proper
error messages for directories, missing files, and unreadable files out
of the box, and simplifies the input resolution logic.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rahim-bhojani
rahim-bhojani merged commit 453014b into main Apr 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants