sqlmesh.dbt.seed API documentation

Edit on GitHub

# sqlmesh.dbt.seed

View Source

     1from __future__ import annotations
     2
     3from sqlmesh.core.model import Model, SeedKind, create_seed_model
     4from sqlmesh.dbt.basemodel import BaseModelConfig
     5from sqlmesh.dbt.common import DbtContext, SqlStr
     6
     7
     8class SeedConfig(BaseModelConfig):
     9    """
    10    seedConfig contains all config parameters available to DBT seeds
    11
    12    See https://docs.getdbt.com/reference/configs-and-properties for
    13    a more detailed description of each config parameter under the
    14    General propreties, General configs, and For seeds sections.
    15    """
    16
    17    @property
    18    def all_sql(self) -> SqlStr:
    19        return SqlStr(";\n".join(self.pre_hook + self.post_hook))
    20
    21    def to_sqlmesh(self, context: DbtContext) -> Model:
    22        """Converts the dbt seed into a SQLMesh model."""
    23        model_context = self._context_for_dependencies(context, self._dependencies)
    24
    25        return create_seed_model(
    26            self.model_name,
    27            SeedKind(path=self.path.absolute()),
    28            **self.sqlmesh_model_kwargs(
    29                model_context,
    30            ),
    31        )

class SeedConfig(sqlmesh.dbt.basemodel.BaseModelConfig): View Source

     9class SeedConfig(BaseModelConfig):
    10    """
    11    seedConfig contains all config parameters available to DBT seeds
    12
    13    See https://docs.getdbt.com/reference/configs-and-properties for
    14    a more detailed description of each config parameter under the
    15    General propreties, General configs, and For seeds sections.
    16    """
    17
    18    @property
    19    def all_sql(self) -> SqlStr:
    20        return SqlStr(";\n".join(self.pre_hook + self.post_hook))
    21
    22    def to_sqlmesh(self, context: DbtContext) -> Model:
    23        """Converts the dbt seed into a SQLMesh model."""
    24        model_context = self._context_for_dependencies(context, self._dependencies)
    25
    26        return create_seed_model(
    27            self.model_name,
    28            SeedKind(path=self.path.absolute()),
    29            **self.sqlmesh_model_kwargs(
    30                model_context,
    31            ),
    32        )

seedConfig contains all config parameters available to DBT seeds

See https://docs.getdbt.com/reference/configs-and-properties for a more detailed description of each config parameter under the General propreties, General configs, and For seeds sections.

def to_sqlmesh( self, context: sqlmesh.dbt.common.DbtContext) -> Annotated[Union[sqlmesh.core.model.definition.SqlModel, sqlmesh.core.model.definition.SeedModel, sqlmesh.core.model.definition.PythonModel], FieldInfo(default=PydanticUndefined, discriminator='source_type', extra={})]: View Source

    22    def to_sqlmesh(self, context: DbtContext) -> Model:
    23        """Converts the dbt seed into a SQLMesh model."""
    24        model_context = self._context_for_dependencies(context, self._dependencies)
    25
    26        return create_seed_model(
    27            self.model_name,
    28            SeedKind(path=self.path.absolute()),
    29            **self.sqlmesh_model_kwargs(
    30                model_context,
    31            ),
    32        )

Converts the dbt seed into a SQLMesh model.

##### Inherited Members

pydantic.main.BaseModel
  BaseModel
  parse_obj
  parse_raw
  parse_file
  from_orm
  construct
  copy
  schema
  schema_json
  validate
  update_forward_refs
sqlmesh.dbt.basemodel.BaseModelConfig
  table_schema
  table_name
  model_name
  sqlmesh_model_kwargs
  render_config
sqlmesh.dbt.common.GeneralConfig
  replace
sqlmesh.dbt.common.DbtConfig
  Config
sqlmesh.core.config.base.BaseConfig
  update_with
sqlmesh.utils.pydantic.PydanticModel
  dict
  json
  missing_required_fields
  extra_fields
  all_fields
  required_fields