docs/integrations/prefect-dbt/api-ref/prefect_dbt-core-runner.mdx
prefect_dbt.core.runnerRunner for dbt commands
execute_dbt_node <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-dbt/prefect_dbt/core/runner.py#L81" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>execute_dbt_node(task_state: NodeTaskTracker, node_id: str, asset_id: Union[str, None])
Execute a dbt node and wait for its completion.
This function will:
PrefectDbtRunner <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-dbt/prefect_dbt/core/runner.py#L107" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>A runner for executing dbt commands with Prefect integration.
This class enables the invocation of dbt commands while integrating with Prefect's logging and assets capabilities.
Args:
manifest: Optional pre-loaded dbt manifestsettings: Optional PrefectDbtSettings instance for configuring dbtraise_on_failure: Whether to raise an error if the dbt command encounters a
non-exception failureclient: Optional Prefect client instanceinclude_compiled_code: Whether to include compiled code in the asset descriptiondisable_assets: Global override for disabling asset generation for dbt nodes. If
True, assets will not be created for any dbt nodes, even if the node's prefect
config has enable_assets set to True._force_nodes_as_tasks: Whether to force each dbt node execution to have a Prefect task
representation when .invoke() is called outside of a flow or task runMethods:
get_dbt_event_msg <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-dbt/prefect_dbt/core/runner.py#L564" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>get_dbt_event_msg(event: EventMsg) -> str
graph <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-dbt/prefect_dbt/core/runner.py#L194" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>graph(self) -> Graph
invoke <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-dbt/prefect_dbt/core/runner.py#L1142" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>invoke(self, args: list[str], **kwargs: Any)
Invokes a dbt command.
Supports the same arguments as dbtRunner.invoke(). https://docs.getdbt.com/reference/programmatic-invocations
Args:
args: List of command line arguments**kwargs: Additional keyword argumentsReturns:
log_level <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-dbt/prefect_dbt/core/runner.py#L183" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>log_level(self) -> EventLevel
manifest <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-dbt/prefect_dbt/core/runner.py#L187" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>manifest(self) -> Manifest
on_run_end <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-dbt/prefect_dbt/core/_hooks.py#L87" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>on_run_end(self, fn: F) -> F
on_run_start <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-dbt/prefect_dbt/core/_hooks.py#L75" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>on_run_start(self, fn: F) -> F
post_model <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-dbt/prefect_dbt/core/_hooks.py#L101" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>post_model(self, fn: F) -> F
profiles_dir <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-dbt/prefect_dbt/core/runner.py#L173" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>profiles_dir(self) -> Path
project_dir <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-dbt/prefect_dbt/core/runner.py#L178" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>project_dir(self) -> Path
project_name <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-dbt/prefect_dbt/core/runner.py#L201" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>project_name(self) -> str
target_path <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-dbt/prefect_dbt/core/runner.py#L168" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>target_path(self) -> Path