> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prefect.io/llms.txt
> Use this file to discover all available pages before exploring further.

# runner

# `prefect_dbt.core.runner`

Runner for dbt commands

## Functions

### `execute_dbt_node` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-dbt/prefect_dbt/core/runner.py#L102" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
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:

1. Set up the task logger
2. Wait for the node to finish using efficient threading.Event
3. Check the node's status and fail if it's in a failure state

## Classes

### `PrefectDbtRunner` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-dbt/prefect_dbt/core/runner.py#L128" 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 manifest
* `settings`: Optional PrefectDbtSettings instance for configuring dbt
* `raise_on_failure`: Whether to raise an error if the dbt command encounters a
  non-exception failure
* `client`: Optional Prefect client instance
* `include_compiled_code`: Whether to include compiled code in the asset description
* `disable_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 run

**Methods:**

#### `get_dbt_event_msg` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-dbt/prefect_dbt/core/runner.py#L592" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
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#L215" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
graph(self) -> Graph
```

#### `invoke` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-dbt/prefect_dbt/core/runner.py#L1173" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
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](https://docs.getdbt.com/reference/programmatic-invocations)

**Args:**

* `args`: List of command line arguments
* `**kwargs`: Additional keyword arguments

**Returns:**

* The result of the dbt command invocation

#### `log_level` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-dbt/prefect_dbt/core/runner.py#L204" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
log_level(self) -> EventLevel
```

#### `manifest` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-dbt/prefect_dbt/core/runner.py#L208" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
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>

```python theme={null}
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>

```python theme={null}
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>

```python theme={null}
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#L194" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
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#L199" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
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#L222" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
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#L189" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python theme={null}
target_path(self) -> Path
```
