Skip to content

feat: support table function fixtures in model tests - #740

Merged
chio-labs-delivery[bot] merged 1 commit into
mainfrom
feat/model-test-table-function-fixtures
Sep 18, 2026
Merged

chio-labs-delivery[bot] merged 1 commit into
mainfrom
feat/model-test-table-function-fixtures

Conversation

@kvlonge

@kvlonge kvlonge commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Why

Model unit tests can mock relation dependencies but currently must deploy every table function used by the model. That prevents isolated model testing when a table function depends on warehouse-only inputs or dialect-specific implementation details.

Changes

  • add __table_fn__<name> CTE fixtures to model-mode SQL tests
  • replace the complete table-function invocation, including nested argument SQL, with the fixture relation
  • validate fixture names, preserve helper CTE visibility, report unreachable fixtures, and expose them in plan inspection
  • omit mocked table functions from test execution dependencies while leaving direct mode table_fn tests unchanged
  • cover SQL-analysis and textual assembly, nested calls, assertions, comments and literals, invalid names, and real DuckDB execution

Verification

  • uv sync --all-extras
  • make check-ci
  • focused Python suite: 127 passed
  • DuckDB end-to-end model test with a table-function fixture
  • independent review and focused follow-up verification
  • cache-free compile against a large downstream project with five representative non-empty fixtures: 0 errors, 0 warnings
  • public repository hygiene scan

@chio-labs-delivery
chio-labs-delivery Bot enabled auto-merge (squash) September 18, 2026 13:02
@chio-labs-delivery
chio-labs-delivery Bot merged commit d09b53a into main Sep 18, 2026
18 checks passed
@chio-labs-delivery
chio-labs-delivery Bot deleted the feat/model-test-table-function-fixtures branch September 18, 2026 13:15
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