Skip to content

Fix: Handle nodes with null relation_name - #1

Open
noel wants to merge 2 commits into
mainfrom
fix/handle-null-relation-name
Open

Fix: Handle nodes with null relation_name#1
noel wants to merge 2 commits into
mainfrom
fix/handle-null-relation-name

Conversation

@noel

@noel noel commented Dec 22, 2025

Copy link
Copy Markdown

Summary

  • Skip nodes that have no relation_name (such as dbt operations like on-run-end hooks) to prevent re.sub() from failing with "expected string or bytes-like object" error
  • Add test to verify null relation_name nodes are properly skipped

Problem

When processing dbt manifests that contain operations (like on-run-end hooks), the build_nodes_with_columns() method would crash because these nodes have relation_name: null. The normalize_table_relation_name() function uses re.sub() which requires a string input.

Example node that caused the error:

{
  "unique_id": "operation.balboa.balboa-on-run-end-0",
  "resource_type": "model",
  "relation_name": null,
  "config": {"materialized": "view"}
}

Solution

Add a check to skip nodes without relation_name (unless they're ephemeral models, which construct their relation name differently).

Test plan

  • Added unit test test_nodes_with_null_relation_name_are_skipped
  • Verified fix works with real dbt manifest containing operations

🤖 Generated with Claude Code

noel and others added 2 commits December 22, 2025 10:36
Skip nodes that have no relation_name (such as dbt operations
like on-run-end hooks) to prevent re.sub() from failing with
"expected string or bytes-like object" error.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds a test to verify that nodes with null relation_name (such as
dbt operations like on-run-end hooks) are properly skipped and don't
cause "expected string or bytes-like object" errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <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.

1 participant