DagsterDocs

dbt (dagster-dbt)

This library provides a Dagster integration with dbt (data build tool), created by dbt Labs.

Ops

dagster_dbt provides a set of pre-built ops that work with either the CLI or RPC interfaces. For more advanced use cases, we suggest building your own ops which directly interact with these resources.

dagster_dbt.dbt_run_op(context)[source]

This op executes a dbt run command. It requires the use of a dbt resource, which can be set to execute this command through the CLI (using the dbt_cli_resource) or over RPC (using the dbt_rpc_sync_resource).

Examples:

from dagster import job
from dagster_dbt import dbt_run_op, dbt_cli_resource, dbt_rpc_sync_resource

@job(resource_defs={"dbt":dbt_cli_resource})
def my_dbt_cli_job():
    dbt_run_op()

@job(resource_defs={"dbt":dbt_rpc_sync_resource})
def my_dbt_rpc_job():
    dbt_run_op()
dagster_dbt.dbt_compile_op(context)[source]

This op executes a dbt compile command. It requires the use of a dbt resource, which can be set to execute this command through the CLI (using the dbt_cli_resource) or over RPC (using the dbt_rpc_sync_resource).

Examples:

from dagster import job
from dagster_dbt import dbt_compile_op, dbt_cli_resource, dbt_rpc_sync_resource

@job(resource_defs={"dbt":dbt_cli_resource})
def my_dbt_cli_job():
    dbt_compile_op()

@job(resource_defs={"dbt":dbt_rpc_sync_resource})
def my_dbt_rpc_job():
    dbt_compile_op()
dagster_dbt.dbt_test_op(context)[source]

This op executes a dbt test command. It requires the use of a dbt resource, which can be set to execute this command through the CLI (using the dbt_cli_resource) or over RPC (using the dbt_rpc_sync_resource).

Examples:

from dagster import job
from dagster_dbt import dbt_test_op, dbt_cli_resource, dbt_rpc_sync_resource

@job(resource_defs={"dbt":dbt_cli_resource})
def my_dbt_cli_job():
    dbt_test_op()

@job(resource_defs={"dbt":dbt_rpc_sync_resource})
def my_dbt_rpc_job():
    dbt_test_op()
dagster_dbt.dbt_snapshot_op(context)[source]

This op executes a dbt snapshot command. It requires the use of a dbt resource, which can be set to execute this command through the CLI (using the dbt_cli_resource) or over RPC (using the dbt_rpc_sync_resource).

Examples:

from dagster import job
from dagster_dbt import dbt_snapshot_op, dbt_cli_resource, dbt_rpc_sync_resource

@job(resource_defs={"dbt":dbt_cli_resource})
def my_dbt_cli_job():
    dbt_snapshot_op()

@job(resource_defs={"dbt":dbt_rpc_sync_resource})
def my_dbt_rpc_job():
    dbt_snapshot_op()
dagster_dbt.dbt_seed_op(context)[source]

This op executes a dbt seed command. It requires the use of a dbt resource, which can be set to execute this command through the CLI (using the dbt_cli_resource) or over RPC (using the dbt_rpc_sync_resource).

Examples:

from dagster import job
from dagster_dbt import dbt_seed_op, dbt_cli_resource, dbt_rpc_sync_resource

@job(resource_defs={"dbt":dbt_cli_resource})
def my_dbt_cli_job():
    dbt_seed_op()

@job(resource_defs={"dbt":dbt_rpc_sync_resource})
def my_dbt_rpc_job():
    dbt_seed_op()
dagster_dbt.dbt_docs_generate_op(context)[source]

This op executes a dbt docs generate command. It requires the use of a dbt resource, which can be set to execute this command through the CLI (using the dbt_cli_resource) or over RPC (using the dbt_rpc_sync_resource).

Examples:

from dagster import job
from dagster_dbt import dbt_docs_generate_op, dbt_cli_resource, dbt_rpc_sync_resource

@job(resource_defs={"dbt":dbt_cli_resource})
def my_dbt_cli_job():
    dbt_docs_generate_op()

@job(resource_defs={"dbt":dbt_rpc_sync_resource})
def my_dbt_rpc_job():
    dbt_docs_generate_op()

Resources

CLI

class dagster_dbt.DbtCliResource(executable, default_flags, warn_error, ignore_handled_error, target_path, logger=None)[source]

A resource that allows you to execute dbt cli commands. For the most up-to-date documentation on the specific parameters available to you for each command, check out the dbt docs:

https://docs.getdbt.com/reference/commands/run

To use this as a dagster resource, we recommend using dbt_cli_resource.

cli(command, **kwargs)[source]
Executes a dbt CLI command. Params passed in as keyword arguments will be merged with the

default flags that were configured on resource initialization (if any) overriding the default values if necessary.

Parameters

command (str) – The command you wish to run (e.g. ‘run’, ‘test’, ‘docs generate’, etc.)

Returns

An instance of DbtCliOutput containing

parsed log output as well as the contents of run_results.json (if applicable).

Return type

DbtCliOutput

compile(models=None, exclude=None, **kwargs)[source]

Run the compile command on a dbt project. kwargs are passed in as additional parameters.

Parameters
  • models (List[str], optional) – the models to include in compilation.

  • exclude (List[str]), optional) – the models to exclude from compilation.

Returns

An instance of DbtCliOutput containing

parsed log output as well as the contents of run_results.json (if applicable).

Return type

DbtCliOutput

freshness(select=None, **kwargs)[source]

Run the source snapshot-freshness command on a dbt project. kwargs are passed in as additional parameters.

Parameters

select (List[str], optional) – the sources to include in the run.

Returns

An instance of DbtCliOutput containing

parsed log output as well as the contents of run_results.json (if applicable).

Return type

DbtCliOutput

generate_docs(compile_project=False, **kwargs)[source]

Run the docs generate command on a dbt project. kwargs are passed in as additional parameters.

Parameters

compile_project (bool, optional) – If true, compile the project before generating a catalog.

Returns

An instance of DbtCliOutput containing

parsed log output as well as the contents of run_results.json (if applicable).

Return type

DbtCliOutput

ls(select=None, models=None, exclude=None, **kwargs)[source]

Run the ls command on a dbt project. kwargs are passed in as additional parameters.

Parameters
  • select (List[str], optional) – the resources to include in the output.

  • models (List[str], optional) – the models to include in the output.

  • exclude (List[str], optional) – the resources to exclude from the output.

Returns

An instance of DbtCliOutput containing

parsed log output as well as the contents of run_results.json (if applicable).

Return type

DbtCliOutput

run(models=None, exclude=None, **kwargs)[source]

Run the run command on a dbt project. kwargs are passed in as additional parameters.

Parameters
  • models (List[str], optional) – the models to include in compilation.

  • exclude (List[str]), optional) – the models to exclude from compilation.

Returns

An instance of DbtCliOutput containing

parsed log output as well as the contents of run_results.json (if applicable).

Return type

DbtCliOutput

run_operation(macro, args=None, **kwargs)[source]

Run the run-operation command on a dbt project. kwargs are passed in as additional parameters.

Parameters
  • macro (str) – the dbt macro to invoke.

  • args (Dict[str, Any], optional) – the keyword arguments to be supplied to the macro.

Returns

An instance of DbtCliOutput containing

parsed log output as well as the contents of run_results.json (if applicable).

Return type

DbtCliOutput

seed(show=False, select=None, exclude=None, **kwargs)[source]

Run the seed command on a dbt project. kwargs are passed in as additional parameters.

Parameters
  • show (bool, optional) – If True, then show a sample of the seeded data in the response. Defaults to False.

  • select (List[str], optional) – the snapshots to include in the run.

  • exclude (List[str], optional) – the snapshots to exclude from the run.

Returns

An instance of DbtCliOutput containing

parsed log output as well as the contents of run_results.json (if applicable).

Return type

DbtCliOutput

snapshot(select=None, exclude=None, **kwargs)[source]

Run the snapshot command on a dbt project. kwargs are passed in as additional parameters.

Parameters
  • select (List[str], optional) – the snapshots to include in the run.

  • exclude (List[str], optional) – the snapshots to exclude from the run.

Returns

An instance of DbtCliOutput containing

parsed log output as well as the contents of run_results.json (if applicable).

Return type

DbtCliOutput

property strict_flags

A set of flags that should not be auto-populated from the default flags unless they are arguments to the associated function.

test(models=None, exclude=None, data=True, schema=True, **kwargs)[source]

Run the test command on a dbt project. kwargs are passed in as additional parameters.

Parameters
  • models (List[str], optional) – the models to include in testing.

  • exclude (List[str], optional) – the models to exclude from testing.

  • data (bool, optional) – If True (default), then run data tests.

  • schema (bool, optional) – If True (default), then run schema tests.

Returns

An instance of DbtCliOutput containing

parsed log output as well as the contents of run_results.json (if applicable).

Return type

DbtCliOutput

class dagster_dbt.DbtCliOutput(command, return_code, raw_output, logs, result)[source]

The results of executing a dbt command, along with additional metadata about the dbt CLI process that was run.

Note that users should not construct instances of this class directly. This class is intended to be constructed from the JSON output of dbt commands.

command

The full shell command that was executed.

Type

str

return_code

The return code of the dbt CLI process.

Type

int

raw_output

The raw output (stdout) of the dbt CLI process.

Type

str

logs

List of parsed JSON logs produced by the dbt command.

Type

List[Dict[str, Any]]

result

Dictionary containing dbt-reported result information contained in run_results.json. Some dbt commands do not produce results, and will therefore have result = None.

Type

Optional[Dict[str, Any]]

dagster_dbt.dbt_cli_resource ResourceDefinition[source]

This resource defines a dbt CLI interface.

To configure this resource, we recommend using the configured method.

Examples:

custom_dbt_cli_resource = dbt_cli_resource.configured({"project-dir": "path/to/my/dbt_project"})

@pipeline(mode_defs=[ModeDefinition(resource_defs={"dbt": custom_dbt_cli_resource})])
def dbt_cli_pipeline():
    # Run solids with `required_resource_keys={"dbt", ...}`.

You may configure this resource as follows:

resources:
  dbt_cli_resource:
    config:
      project_dir: "."
      # Optional[str]: Which directory to look in for the dbt_project.yml file. Default is
      # the current working directory and its parents.
      profiles_dir: $DBT_PROFILES_DIR or $HOME/.dbt
      # Optional[str]: Which directory to look in for the profiles.yml file.
      profile: ""
      # Optional[str]: Which profile to load. Overrides setting in dbt_project.yml.
      target: ""
      # Optional[str]: Which target to load for the given profile.
      vars: {}
      # Optional[Permissive]: Supply variables to the project. This argument overrides
      # variables defined in your dbt_project.yml file. This argument should be a
      # dictionary, eg. "{'my_variable': 'my_value'}"
      bypass_cache: False
      # Optional[bool]: If set, bypass the adapter-level cache of database state.

RPC

class dagster_dbt.DbtRpcClient(host='0.0.0.0', port=8580, jsonrpc_version='2.0', logger=None, **_)[source]

A client for a dbt RPC server.

To use this as a dagster resource, we recommend using dbt_rpc_resource.

cli(command, **kwargs)[source]

Sends a request with CLI syntax to the dbt RPC server, and returns the response. For more details, see the dbt docs for running CLI commands via RPC.

Parameters

cli (str) – a dbt command in CLI syntax.

Returns

the HTTP response from the dbt RPC server.

Return type

Response

compile(models=None, exclude=None, **kwargs)[source]

Sends a request with the method compile to the dbt RPC server, and returns the response. For more details, see the dbt docs for compiling projects via RPC.

Parameters
  • models (List[str], optional) – the models to include in compilation.

  • exclude (List[str]), optional) – the models to exclude from compilation.

Returns

the HTTP response from the dbt RPC server.

Return type

Response

compile_sql(sql, name)[source]

Sends a request with the method compile_sql to the dbt RPC server, and returns the response. For more details, see the dbt docs for compiling SQL via RPC.

Parameters
  • sql (str) – the SQL to compile in base-64 encoding.

  • name (str) – a name for the compiled SQL.

Returns

the HTTP response from the dbt RPC server.

Return type

Response

generate_docs(compile_project=False, **kwargs)[source]

Sends a request with the method docs.generate to the dbt RPC server, and returns the response. For more details, see the dbt docs for the RPC method docs.generate.

Parameters

compile_project (bool, optional) – If true, compile the project before generating a catalog.

property host

The IP address of the host of the dbt RPC server.

Type

str

property jsonrpc_version

The JSON-RPC version to send in RPC requests.

Type

str

kill(task_id)[source]

Sends a request with the method kill to the dbt RPC server, and returns the response. For more details, see the dbt docs for the RPC method kill.

Parameters

task_id (str) – the ID of the task to terminate.

Returns

the HTTP response from the dbt RPC server.

Return type

Response

property logger

A property for injecting a logger dependency.

Type

Optional[Any]

ls(select=None, models=None, exclude=None, **kwargs)[source]

Sends a request with the method list to the dbt RPC server, and returns the response. For more details, see the dbt docs for compiling projects via RPC.

Parameters
  • select (List[str], optional) – the resources to include in the output.

  • models (List[str], optional) – the models to include in the output.

  • exclude (List[str]), optional) – the resources to exclude from compilation.

Returns

the HTTP response from the dbt RPC server.

Return type

Response

poll(request_token, logs=False, logs_start=0)[source]

Sends a request with the method poll to the dbt RPC server, and returns the response. For more details, see the dbt docs for the RPC method poll.

Parameters
  • request_token (str) – the token to poll responses for.

  • logs (bool) – Whether logs should be returned in the response. Defaults to False.

  • logs_start (int) – The zero-indexed log line to fetch logs from. Defaults to 0.

Returns

the HTTP response from the dbt RPC server.

Return type

Response

property port

The port of the dbt RPC server.

Type

int

ps(completed=False)[source]

Sends a request with the method ps to the dbt RPC server, and returns the response. For more details, see the dbt docs for the RPC method ps.

Parameters

compelted (bool) – If True, then also return completed tasks. Defaults to False.

Returns

the HTTP response from the dbt RPC server.

Return type

Response

run(models=None, exclude=None, **kwargs)[source]

Sends a request with the method run to the dbt RPC server, and returns the response. For more details, see the dbt docs for the RPC method run.

Parameters
  • models (List[str], optional) – the models to include in the run.

  • exclude (List[str]), optional) – the models to exclude from the run.

Returns

the HTTP response from the dbt RPC server.

Return type

Response

run_operation(macro, args=None, **kwargs)[source]

Sends a request with the method run-operation to the dbt RPC server, and returns the response. For more details, see the dbt docs for the command run-operation.

Parameters
  • macro (str) – the dbt macro to invoke.

  • args (Dict[str, Any], optional) – the keyword arguments to be supplied to the macro.

Returns

the HTTP response from the dbt RPC server.

Return type

Response

run_sql(sql, name)[source]

Sends a request with the method run_sql to the dbt RPC server, and returns the response. For more details, see the dbt docs for running SQL via RPC.

Parameters
  • sql (str) – the SQL to run in base-64 encoding.

  • name (str) – a name for the compiled SQL.

Returns

the HTTP response from the dbt RPC server.

Return type

Response

seed(show=False, select=None, exclude=None, **kwargs)[source]

Sends a request with the method seed to the dbt RPC server, and returns the response. For more details, see the dbt docs for the RPC method seed.

Parameters
  • show (bool, optional) – If True, then show a sample of the seeded data in the response. Defaults to False.

  • select (List[str], optional) – the snapshots to include in the run.

  • exclude (List[str], optional) – the snapshots to exclude from the run.

Returns

the HTTP response from the dbt RPC server.

Return type

Response

snapshot(select=None, exclude=None, **kwargs)[source]

Sends a request with the method snapshot to the dbt RPC server, and returns the response. For more details, see the dbt docs for the command snapshot.

Parameters
  • select (List[str], optional) – the snapshots to include in the run.

  • exclude (List[str], optional) – the snapshots to exclude from the run.

Returns

the HTTP response from the dbt RPC server.

Return type

Response

snapshot_freshness(select=None, **kwargs)[source]

Sends a request with the method snapshot-freshness to the dbt RPC server, and returns the response. For more details, see the dbt docs for the command source snapshot-freshness.

Parameters

select (List[str], optional) – the models to include in calculating snapshot freshness.

Returns

the HTTP response from the dbt RPC server.

Return type

Response

status()[source]

Sends a request with the method status to the dbt RPC server, and returns the response. For more details, see the dbt docs for the RPC method status.

Returns

the HTTP response from the dbt RPC server.

Return type

Response

test(models=None, exclude=None, data=True, schema=True, **kwargs)[source]

Sends a request with the method test to the dbt RPC server, and returns the response. For more details, see the dbt docs for the RPC method test.

Parameters
  • models (List[str], optional) – the models to include in testing.

  • exclude (List[str], optional) – the models to exclude from testing.

  • data (bool, optional) – If True (default), then run data tests.

  • schema (bool, optional) – If True (default), then run schema tests.

Returns

the HTTP response from the dbt RPC server.

Return type

Response

property url

The URL for sending dbt RPC requests.

Type

str

class dagster_dbt.DbtRpcOutput(response)[source]

The output from executing a dbt command via the dbt RPC server.

result

The parsed contents of the “result” field of the JSON response from the rpc server (if any).

Type

Dict[str, Any]

response_dict

The entire contents of the JSON response from the rpc server.

Type

Dict[str, Any]

response

The original Response from which this output was generated.

Type

requests.Response

dagster_dbt.local_dbt_rpc_resource ResourceDefinition

This resource defines a dbt RPC client for an RPC server running on 0.0.0.0:8580.

dagster_dbt.dbt_rpc_resource ResourceDefinition[source]

This resource defines a dbt RPC client.

To configure this resource, we recommend using the configured method.

Examples:

custom_dbt_rpc_resource = dbt_rpc_resource.configured({"host": "80.80.80.80","port": 8080,})

@pipeline(mode_defs=[ModeDefinition(resource_defs={"dbt_rpc": custom_dbt_rpc_resource})])
def dbt_rpc_pipeline():
    # Run solids with `required_resource_keys={"dbt_rpc", ...}`.
dagster_dbt.dbt_rpc_sync_resource ResourceDefinition[source]

This resource defines a synchronous dbt RPC client.

To configure this resource, we recommend using the configured method.

Examples:

custom_sync_dbt_rpc_resource = dbt_rpc_sync_resource.configured({"host": "80.80.80.80","port": 8080,})

@pipeline(mode_defs=[ModeDefinition(resource_defs={"dbt_rpc": custom_dbt_rpc_sync_resource})])
def dbt_rpc_pipeline():
    # Run solids with `required_resource_keys={"dbt_rpc", ...}`.

Types

class dagster_dbt.DbtOutput(result)[source]

Base class for both DbtCliOutput and DbtRPCOutput. Contains a single field, result, which represents the dbt-formatted result of the command that was run (if any).

Used internally, should not be instantiated directly by the user.

class dagster_dbt.DbtResource(logger=None)[source]

Base class for a resource allowing users to interface with dbt

abstract compile(models=None, exclude=None, **kwargs)[source]

Run the compile command on a dbt project. kwargs are passed in as additional parameters.

Parameters
  • models (List[str], optional) – the models to include in compilation.

  • exclude (List[str]), optional) – the models to exclude from compilation.

Returns

object containing parsed output from dbt

Return type

DbtOutput

abstract generate_docs(compile_project=False, **kwargs)[source]

Run the docs generate command on a dbt project. kwargs are passed in as additional parameters.

Parameters

compile_project (bool, optional) – If true, compile the project before generating a catalog.

Returns

object containing parsed output from dbt

Return type

DbtOutput

property logger

A property for injecting a logger dependency.

Type

Optional[Any]

abstract ls(select=None, models=None, exclude=None, **kwargs)[source]

Run the ls command on a dbt project. kwargs are passed in as additional parameters.

Parameters
  • select (List[str], optional) – the resources to include in the output.

  • models (List[str], optional) – the models to include in the output.

  • exclude (List[str], optional) – the resources to exclude from the output.

Returns

object containing parsed output from dbt

Return type

DbtOutput

abstract run(models=None, exclude=None, **kwargs)[source]

Run the run command on a dbt project. kwargs are passed in as additional parameters.

Parameters
  • models (List[str], optional) – the models to include in the run.

  • exclude (List[str]), optional) – the models to exclude from the run.

Returns

object containing parsed output from dbt

Return type

DbtOutput

abstract run_operation(macro, args=None, **kwargs)[source]

Run the run-operation command on a dbt project. kwargs are passed in as additional parameters.

Parameters
  • macro (str) – the dbt macro to invoke.

  • args (Dict[str, Any], optional) – the keyword arguments to be supplied to the macro.

Returns

object containing parsed output from dbt

Return type

DbtOutput

abstract seed(show=False, select=None, exclude=None, **kwargs)[source]

Run the seed command on a dbt project. kwargs are passed in as additional parameters.

Parameters
  • show (bool, optional) – If True, then show a sample of the seeded data in the response. Defaults to False.

  • select (List[str], optional) – the snapshots to include in the run.

  • exclude (List[str], optional) – the snapshots to exclude from the run.

Returns

object containing parsed output from dbt

Return type

DbtOutput

abstract snapshot(select=None, exclude=None, **kwargs)[source]

Run the snapshot command on a dbt project. kwargs are passed in as additional parameters.

Parameters
  • select (List[str], optional) – the snapshots to include in the run.

  • exclude (List[str], optional) – the snapshots to exclude from the run.

Returns

object containing parsed output from dbt

Return type

DbtOutput

abstract test(models=None, exclude=None, data=True, schema=True, **kwargs)[source]

Run the test command on a dbt project. kwargs are passed in as additional parameters.

Parameters
  • models (List[str], optional) – the models to include in testing.

  • exclude (List[str], optional) – the models to exclude from testing.

  • data (bool, optional) – If True (default), then run data tests.

  • schema (bool, optional) – If True (default), then run schema tests.

Returns

object containing parsed output from dbt

Return type

DbtOutput

Errors

exception dagster_dbt.DagsterDbtError(description=None, metadata_entries=None, metadata=None)[source]

The base exception of the dagster-dbt library.

exception dagster_dbt.DagsterDbtCliRuntimeError(description, logs, raw_output)[source]

Represents an error while executing a dbt CLI command.

exception dagster_dbt.DagsterDbtCliFatalRuntimeError(logs, raw_output)[source]

Represents a fatal error in the dbt CLI (return code 2).

exception dagster_dbt.DagsterDbtCliHandledRuntimeError(logs, raw_output)[source]

Represents a model error reported by the dbt CLI at runtime (return code 1).

exception dagster_dbt.DagsterDbtCliOutputsNotFoundError(path)[source]

Represents a problem in finding the target/run_results.json artifact when executing a dbt CLI command.

For more details on target/run_results.json, see https://docs.getdbt.com/reference/dbt-artifacts#run_resultsjson.

exception dagster_dbt.DagsterDbtCliUnexpectedOutputError(invalid_line_nos)[source]

Represents an error when parsing the output of a dbt CLI command.

exception dagster_dbt.DagsterDbtRpcUnexpectedPollOutputError(description=None, metadata_entries=None, metadata=None)[source]

Represents an unexpected response when polling the dbt RPC server.

Solids [Legacy]

dagster_dbt provides a set of solids that may be used in legacy pipelines.

CLI

dagster_dbt.dbt_cli_compile(context)[source]

This solid executes dbt compile via the dbt CLI.

dagster_dbt.dbt_cli_run(context)[source]

This solid executes dbt run via the dbt CLI. See the solid definition for available parameters.

dagster_dbt.dbt_cli_run_operation(context)[source]

This solid executes dbt run-operation via the dbt CLI.

dagster_dbt.dbt_cli_snapshot(context)[source]

This solid executes dbt snapshot via the dbt CLI.

dagster_dbt.dbt_cli_snapshot_freshness(context)[source]

This solid executes dbt source snapshot-freshness via the dbt CLI.

dagster_dbt.dbt_cli_test(context)[source]

This solid executes dbt test via the dbt CLI. See the solid definition for available parameters.

RPC

dagster_dbt.create_dbt_rpc_run_sql_solid(name, output_def=None, **kwargs)[source]

This function is a factory which constructs a solid that will copy the results of a SQL query run within the context of a dbt project to a pandas DataFrame.

Any kwargs passed to this function will be passed along to the underlying @solid decorator. However, note that overriding config_schema, input_defs, and required_resource_keys is not allowed and will throw a DagsterInvalidDefinitionError.

If you would like to configure this solid with different config fields, you could consider using @composite_solid to wrap this solid.

Parameters
  • name (str) – The name of this solid.

  • output_def (OutputDefinition, optional) – The OutputDefinition for the solid. This value should always be a representation of a pandas DataFrame. If not specified, the solid will default to an OutputDefinition named “df” with a DataFrame dagster type.

Returns

Returns the constructed solid definition.

Return type

SolidDefinition

dagster_dbt.dbt_rpc_compile_sql(context, sql)[source]

This solid sends the dbt compile command to a dbt RPC server and returns the request token.

This dbt RPC solid is asynchronous. The request token can be used in subsequent RPC requests to poll the progress of the running dbt process.

dagster_dbt.dbt_rpc_run(context)[source]

This solid sends the dbt run command to a dbt RPC server and returns the request token.

This dbt RPC solid is asynchronous. The request token can be used in subsequent RPC requests to poll the progress of the running dbt process.

dagster_dbt.dbt_rpc_run_and_wait(context)[source]

This solid sends the dbt run command to a dbt RPC server and returns the result of the executed dbt process.

This dbt RPC solid is synchronous, and will periodically poll the dbt RPC server until the dbt process is completed.

dagster_dbt.dbt_rpc_run_operation(context)[source]

This solid sends the dbt run-operation command to a dbt RPC server and returns the request token.

This dbt RPC solid is asynchronous. The request token can be used in subsequent RPC requests to poll the progress of the running dbt process.

dagster_dbt.dbt_rpc_run_operation_and_wait(context)[source]

This solid sends the dbt run-operation command to a dbt RPC server and returns the result of the executed dbt process.

This dbt RPC solid is synchronous, and will periodically poll the dbt RPC server until the dbt process is completed.

dagster_dbt.dbt_rpc_snapshot(context)[source]

This solid sends the dbt snapshot command to a dbt RPC server and returns the request token.

This dbt RPC solid is asynchronous. The request token can be used in subsequent RPC requests to poll the progress of the running dbt process.

dagster_dbt.dbt_rpc_snapshot_and_wait(context)[source]

This solid sends the dbt snapshot command to a dbt RPC server and returns the result of the executed dbt process.

This dbt RPC solid is synchronous, and will periodically poll the dbt RPC server until the dbt process is completed.

dagster_dbt.dbt_rpc_snapshot_freshness(context)[source]

This solid sends the dbt source snapshot-freshness command to a dbt RPC server and returns the request token.

This dbt RPC solid is asynchronous. The request token can be used in subsequent RPC requests to poll the progress of the running dbt process.

dagster_dbt.dbt_rpc_snapshot_freshness_and_wait(context)[source]

This solid sends the dbt source snapshot command to a dbt RPC server and returns the result of the executed dbt process.

This dbt RPC solid is synchronous, and will periodically poll the dbt RPC server until the dbt process is completed.

dagster_dbt.dbt_rpc_test(context)[source]

This solid sends the dbt test command to a dbt RPC server and returns the request token.

This dbt RPC solid is asynchronous. The request token can be used in subsequent RPC requests to poll the progress of the running dbt process.

dagster_dbt.dbt_rpc_test_and_wait(context)[source]

This solid sends the dbt test command to a dbt RPC server and returns the result of the executed dbt process.

This dbt RPC solid is synchronous, and will periodically poll the dbt RPC server until the dbt process is completed.