Skip to content

Feat: Add Tableau context-source adapter - #344

Open
sailingsam wants to merge 4 commits into
Kaelio:mainfrom
sailingsam:feat/tableau-adapter
Open

Feat: Add Tableau context-source adapter#344
sailingsam wants to merge 4 commits into
Kaelio:mainfrom
sailingsam:feat/tableau-adapter

Conversation

@sailingsam

@sailingsam sailingsam commented Jul 5, 2026

Copy link
Copy Markdown

Closes #166.

Adds a tableau context source that ingests published data sources, calculated fields, and workbook metadata from Tableau Cloud / Tableau Server via the REST API (PAT auth) + Metadata API (GraphQL).

Approach

  • Modeled on the Looker adapter's graph-shaped semantic model (a published data source = fields + calculated fields + upstream tables), built on the newer Sigma adapter's clean scaffolding to keep the wiring surface small.
  • Wiki-only in this PR. The tableau_ingest skill turns data sources and workbooks into ktx wiki knowledge (calculated-field formulas → candidate metric definitions). Deterministic semantic-layer projection (project()) is intentionally left as a follow-up — see note below.
  • Auth is a Personal Access Token resolved via env: / file: reference (existing resolveKtxConfigReference helper).

Note on the issue path: the issue lists packages/context/src/ingest/adapters/tableau/; the current layout is packages/cli/src/context/ingest/adapters/tableau/, which is what this PR targets (matches the area:connectors label).

Acceptance criteria

  • New adapter under adapters/tableau/ with tests
  • Ingest reads published data sources, calculated fields, and workbook names
  • Output writes wiki/global/ Markdown (the "and/or" wiki branch; SL YAML deferred — see below)
  • Authentication uses Tableau PAT via env: or file: reference
  • Integration docs added (context-sources.mdx + README)

Verified live end-to-end

Ran the adapter against a real Tableau Cloud (Developer Program) site:

Found 1 published data source(s).
  Staged data source: Superstore Datasource
Found 3 workbook(s).
  Staged workbook: Superstore
  Staged workbook: sales overview
  Staged workbook: World Indicators

Superstore Datasource — 34 fields
  └─ calculated field "Profit Ratio"  →  formula: SUM([Profit])/SUM([Sales])
  └─ upstream tables: Orders, Returns, People

The captured bundle is committed as a real-data test fixture (test/fixtures/tableau/superstore-live/), so the adapter is grounded in genuine Metadata API output, not hand-authored shapes.

Screenshots

  • Tableau workbook (sales overview) using the Profit Ratio calculated field: image
  • Calculated field definition: image
  • Generated Wiki: image
  • Ingest: image

Why project() (semantic-layer YAML) is a follow-up

Deterministic SL projection maps a data source's upstream warehouse tables to ktx semantic-layer sources. Faithfully building + testing this needs a warehouse-backed Tableau data source (Snowflake/Postgres/etc.); the sample data available for this PR is Excel-backed (upstream tables are workbook sheets, no warehouse schema), so an SL projection couldn't be exercised end-to-end. Rather than ship an unverified mapping, this PR is wiki-only (which satisfies the acceptance criteria's "and/or"), and SL projection will follow once a warehouse-backed test source is available.

Testing

  • 28 adapter tests (client / fetch / detect / chunk / adapter / client-boundary / live-data)
  • Full fast suite green (3523 tests), tsc typecheck + Biome clean

…ient, fetch, tests)

Adds a new `tableau` context source under
packages/cli/src/context/ingest/adapters/tableau/, modeled on the Sigma
adapter's scaffolding and Looker's graph-shaped semantic model. This first
commit covers the read path: PAT sign-in (REST) + published data sources,
calculated fields, and workbook metadata via the Metadata API (GraphQL),
staged to disk and chunked into work units.

- client.ts: PAT auth + Metadata GraphQL, retry + 401 re-auth, offset paging
- fetch.ts: stages datasources/<luid>.json + workbooks/<luid>.json + manifest
- detect.ts / chunk.ts: bundle detection + data-source / workbook work units
- driver-schemas.ts: `tableau` connection (host, site, PAT via env:/file: ref)
- wired into local-adapters, setup-sources, setup-commands, public-ingest
- Vitest suite (client, fetch, detect, chunk, adapter, client-boundary) with
  fixtures under test/fixtures/tableau/

Note: the issue's path packages/context/src/ingest/adapters/tableau/ is stale;
the real location is packages/cli/src/context/ingest/adapters/tableau/.

Wiki output (tableau_ingest skill) and deterministic semantic-layer projection
follow in subsequent commits. Refs Kaelio#166.
Adds packages/cli/src/skills/tableau_ingest/SKILL.md, the memory-agent skill
loaded for tableau-datasources / tableau-workbooks work units. It extracts
durable ktx wiki knowledge from published data sources (field names,
calculated-field formulas as metric definitions) and workbook summaries via
context_candidate_write, with the standard identifier-verification protocol.

v1 is wiki-only: the skill states that no semantic-layer YAML is written for
Tableau yet (deterministic project() follows in the next commit).

Registers tableau_ingest in the memory-runtime-assets adapter-skill and
verification-writer checks. Refs Kaelio#166.
Adds a Tableau section to the context-sources integration guide (connection
config, PAT auth via env:/file: reference, Cloud vs Server host, data source /
workbook filters, and a pointer to the free Tableau Developer Program sandbox)
and lists `tableau` in the driver table, page description, and README connector
list.

Notes that this release is wiki-only; deterministic semantic-layer projection
is planned for a follow-up. Refs Kaelio#166.
…ression test

Captured a real staged bundle by running the adapter's fetch() against a live
Tableau Cloud (Developer) site's built-in "Superstore" sample data source, and
committed it under test/fixtures/tableau/superstore-live/. Adds a regression
test that detects, chunks, and parses the real bundle and asserts the
"Profit Ratio" calculated field (formula SUM([Profit])/SUM([Sales])) and the
upstream lineage are surfaced.

This grounds the adapter in genuine Metadata API output: confirms the GraphQL
field selection (luid, name, role, dataType, CalculatedField.formula,
upstreamTables) matches the live schema. Refs Kaelio#166.
@vercel

vercel Bot commented Jul 5, 2026

Copy link
Copy Markdown

@sailingsam is attempting to deploy a commit to the Kaelio Team on Vercel.

A member of the Team first needs to authorize it.

@sailingsam
sailingsam marked this pull request as ready for review July 5, 2026 23:02
@anishfyi

Copy link
Copy Markdown

will check this over the weekend!

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.

Add Tableau context source

2 participants