Skip to content

Commit 25ff793

Browse files
docs: document UnitTestDefinition attribute pitfall in prefect-dbt core AGENTS.md (#21994)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 0d88257 commit 25ff793

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • src/integrations/prefect-dbt/prefect_dbt/core

src/integrations/prefect-dbt/prefect_dbt/core/AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Non-obvious behaviors:
5858

5959
## Pitfalls
6060

61+
- `UnitTestDefinition` (dbt-core 1.8+) lacks `config.materialized` and `relation_name`. When adding any attribute access on a manifest node, guard with `isinstance(node, ManifestNode)` for attributes that don't exist on `UnitTestDefinition`. Unit test nodes come from `manifest.unit_tests`, not `manifest.nodes`.
6162
- `_initialize_dbt_hooks()` must be called in `__init__`; both runner and orchestrator already do this. If you subclass either without calling `super().__init__()`, `_dbt_hooks` will be absent and `_has_dbt_hooks()` will raise `AttributeError`.
6263
- The selection cache is built once before execution begins; hook selectors that reference nodes not in the resolved manifest will match nothing silently.
6364
- `post_model` hooks in `PrefectDbtRunner` run in the background callback thread, not the main thread. Avoid thread-unsafe side effects.

0 commit comments

Comments
 (0)