Repository navigation
Fix CLI issues found testing the MCP parity commands live - #68
Merged
Merged
Conversation
- dataset search: print "results": [] instead of null when nothing matches. - query update: refuse --parameters null, which sent an empty update, and --temp with --archived, since archiving clears the temp flag. - query get -o json: leave out the latest execution keys when they could not be read, instead of null, which means "never run". - execution results: fail when a shaped wait times out instead of printing the running state with exit 0. - viz create/update: --options accepts @path and @-, as the README says. - folder move/move-content: refuse an empty --to. - README: --owner-scope and --include-private still work in dataset search. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1f35e-4422-71d4-a903-056e89e15547
norbertdurcansk
approved these changes
Nov 20, 2026
norbertdurcansk
left a comment
Contributor
There was a problem hiding this comment.
Approved, with one nit. Each fix matches the description and each regression test exercises the behavior it names; CI is green.
Question: the README query update row doesn't mention that --temp and --archived are mutually exclusive. The runtime error is probably enough; fine to leave.
On update it would have replaced the visualization's options with null, since the update request sends options without omitempty; on create it sent none. Options are now parsed before any API call. Amp-Thread-ID: https://ampcode.com/threads/T-01a1f35e-4422-71d4-a903-056e89e15547 Co-authored-by: Amp <amp@ampcode.com>
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Follow-up to #67. Testing the new commands live with a real API key turned up a few places where the CLI reports success, or prints output a script misreads, when it did not do what was asked. This fixes them and two README errors.
Changes
dataset search -o jsonprinted"results": nullwhen nothing matched; main printed[], sojq '.results[]'broke. It prints[]again.query update --parameters nullsent an empty PATCH and printed "Updated query". It now fails and points to'[]'to clear the parameters.query update --temp --archivedprinted success, but the query ended up not temporary: REST/archiveclearsis_temp(checked live:--tempalone sets it, a later archive clears it). The combination is now refused before any call.query get -o jsonprintedlatest_execution_id: nullboth when the query never ran and when the MCP lookup failed. On a failed lookup the two keys are now left out; the text output already said "unknown".execution resultswith shaping flags printed the running state and exited 0 when--timeoutpassed. It now fails with the state and a hint.viz create/update --optionsaccepts@pathand@-, as the README already said, through the samecmdutil.JSONFlagas--config.folder move/move-contentrefuse--to ""(for example an unset shell variable) instead of sending an empty folder ID.--owner-scopeand--include-privatestill filterdataset searchthrough REST; the README said they were deprecated.Blast radius: CLI users and scripts only. Scripts that relied on the exit code 0 of a timed-out shaped
execution results, or onnulllatest-execution keys after an MCP failure, see a change.Not changed
execution resultsignores--timeout: the SDK'sWaitGetResultsonly counts errors, not time. That predates Bring the CLI to parity with the Dune MCP server #67; a fix belongs in duneapi-client-go.create-and-run -o jsonmixes snake_case and camelCase keys (result_preview.executionId,visualization.chartJpegUrl), as doesviz create --chart-type -o json, because they pass the MCP result through. Changing it would break anyone parsing it today.Tests
go vet ./...andgo test -race ./...pass.query updatecombinations,query get -o jsonafter a failed lookup, and the shaped timeout. Each fails with its fix reverted.Agent context
dataset searchwith no hits →[];query update --parameters nulland--temp --archived→ refused, no calls;folder move abc --to ""→ refused;viz update --type counter --options @opts.json→ saved options read back identical. Probe query 9161138 is archived.