Skip to content

Add --timeout to query and card query - #78

Open
cirdes wants to merge 1 commit into
metabase:mainfrom
cirdes:query-timeout-flag
Open

cirdes wants to merge 1 commit into
metabase:mainfrom
cirdes:query-timeout-flag

Conversation

@cirdes

@cirdes cirdes commented Oct 17, 2026

Copy link
Copy Markdown

Summary

  • mb query and mb card query take --timeout <ms> (default 30000), the flag transform-test run already has
  • the timeout covers the run and the export, including the export's download; --dry-run, --compile and --metadata keep the transport default
  • the flag definition moves to timeoutFlag in commands/flags.ts, and transform-test run uses it too
  • README rows and examples for both commands

Queries that run past 30s fail today with Request timed out after 30000ms, and there's no way to give them longer.

Agent authorship

The implementation and tests were written by an AI coding agent and reviewed by me.

Testing

  • bun run check (153 test files, 1804 tests; typecheck, lint, formatting and skill lint passed)
  • e2e on the default stack: query.e2e.test.ts and card.e2e.test.ts, 66 passed. The new cases run a pg_sleep(3) native query with --timeout 500 and assert the timeout error and exit code, for a run and for a CSV export, and assert that a non-integer --timeout is rejected as a ConfigError.

Closes #77

🤖 Generated with Claude Code

A query that runs past the transport's 30s default failed with no way
to wait longer. query and card query take the same --timeout flag
transform-test run has, shared from flags.ts, and pass it to the run
and the export.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

Feature request: configurable request timeout for mb query and mb card query

1 participant