Skip to content

Conversation

@AdityaHegde
Copy link
Collaborator

Models that have errored partitions but the output table is created, we can still support export or create metrics view CTAs. Updating to check for resultTable.

Simple set of models to simulate partition errors,

type: model

partitions:
  sql: |
    select 'facebook' as id
    union all
    select 'google' as id
    union all
    select 'yahoo' as id

sql: |
  select * exclude(json), cast(json as JSON) as parsed  from "partition_{{.partition.id}}"
-- partition_facebook.sql
SELECT 'Facebook' as publisher, 'instagram.com' as domain, '{}' as json
UNION ALL
SELECT 'Facebook' as publisher, 'facebook.com' as domain, '{-}' as json
-- partition_google.sql
SELECT 'Google' as publisher, 'search.google.com' as domain, '{}' as json
UNION ALL
SELECT 'Google' as publisher, 'news.google.com' as domain, '{}' as json
-- partition_yahoo.sql
SELECT 'Facebook' as publisher, 'instagram.com' as domain, '{}' as json
UNION ALL
SELECT 'Facebook' as publisher, 'facebook.com' as domain, '{}' as json

Closes APP-400

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

Copy link
Contributor

@ericpgreen2 ericpgreen2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking suggestions:

  1. Consistency in ModelWorkspaceCTAs.svelte: The "Create metrics view" menu item (lines 95-102) is always enabled, even when no result table exists. For consistency with CreateDashboardButton, consider adding disabled={!hasResultTable} to that menu item.

  2. Consider adding a comment: The distinction between "has errors" and "has result table" is subtle. A brief comment at the derivation site would help future developers understand why we check for the result table rather than error state:

    // A model can have errors (e.g., failed partitions) but still produce a result table.
    // We enable export/metrics-view actions based on whether output exists, not error state.
    $: hasResultTable = !!tableName;

Developed in collaboration with Claude Code

@AdityaHegde AdityaHegde merged commit c99d740 into main Jan 8, 2026
10 checks passed
@AdityaHegde AdityaHegde deleted the fix/enable-export-for-errored-partitions branch January 8, 2026 05:41
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.

3 participants