Stephanie Polkinghorne
08/07/2023, 12:20 PM@dbt_assets(manifest=MANIFEST_PATH)
def modelling_dbt_asset(context: OpExecutionContext, dbt_resource: DbtCliResource):
yield from dbt_resource.cli(["run"], context=context).stream()
modelling_selection = build_dbt_asset_selection([modelling_dbt_asset], dbt_select="tag:modelling")
modelling_dbt_schedule = ScheduleDefinition(
job=define_asset_job("modelling_selection", selection=modelling_selection),
cron_schedule="@daily",
)
I have also tried using build_schedule_from_dbt_selection
to build the schedule.
However I am getting the following error when building the repository using the @repository
decorator:
DLAKE_REPO_GRPC: dagster._core.errors.DagsterInvalidDefinitionError: Bad return value from repository construction function: all elements of list must be of type JobDefinition, GraphDefinition, ScheduleDefinition, SensorDefinition, AssetsDefinition, or SourceAsset.Got value of type <class 'dagster_dbt.dbt_manifest_asset_selection.DbtManifestAssetSelection'> at index 7.
Does the @dbt_assets
not work with the self-hosted dagster?rex
08/07/2023, 1:52 PM@repository
decorated function? @dbt_assets
works with Dagster open source. My hunch is that you’re passing in modelling_selection
intstead of modelling_dbt_schedule
to your @repository
.Stephanie Polkinghorne
08/07/2023, 1:57 PM@repository
- so that is where the error is coming from - when I only pass modelling_dbt_schedule
, the job is registered but has no assets loaded. So I was trying to pass in the AssetDefinitions as well.Stephanie Polkinghorne
08/08/2023, 6:15 AMStephanie Polkinghorne
08/08/2023, 9:07 AM