Skip to content

[DBA-126] Fix dbt source count showing 0 connections#65

Closed
gasparian wants to merge 1 commit intomainfrom
andrei.gasparian/DBA-126-fix-dbt-source-count
Closed

[DBA-126] Fix dbt source count showing 0 connections#65
gasparian wants to merge 1 commit intomainfrom
andrei.gasparian/DBA-126-fix-dbt-source-count

Conversation

@gasparian
Copy link
Contributor

Summary

The CLI reported "Connected to 0 data source(s)" when only dbt sources were configured, because the source count only summed dbs + dfs, omitting dbts. This fix adds len(agent.sources.dbts) to the count in all 4 affected locations (CLI, welcome page, sidebar, context settings).

Changes

Fix source counting to include dbt

Added dbts to source count and display logic.

Files
  • src/databao_cli/commands/ask.py
  • src/databao_cli/ui/pages/welcome.py
  • src/databao_cli/ui/components/sidebar.py
  • src/databao_cli/ui/pages/context_settings.py

Add regression tests

Two new tests verifying dbt-only and mixed source counting.

Files
  • tests/test_ask.py

Test Plan

  • uv run pytest tests/test_ask.py -v — 3 tests pass
  • uv run ruff check + mypy — clean
  • Manual: configure a dbt-only project, run databao ask, verify count > 0

🤖 Generated with Claude Code

Include dbt sources (agent.sources.dbts) in the source count across
CLI ask command, welcome page, sidebar, and context settings. Previously
only dbs and dfs were counted, causing "Connected to 0 data source(s)"
when only dbt sources were configured.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gasparian gasparian requested a review from a team March 19, 2026 15:51
@gasparian gasparian closed this Mar 19, 2026
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