Hey everyone, is it possible to create an `op` tha...
# integration-dbt
g
Hey everyone, is it possible to create an
op
that is automatically run downstream of a dbt model based on the presence of a meta tag?
n
Is the meta tag, a Dagster job run tag? You can retrieve successful job runs for specific tags like this:
Copy code
context.instance.get_runs(
            RunsFilter(
                job_name=your_job.name,
                tags={"your_tag_name": your_tag_value}, 
                statuses=[DagsterRunStatus.SUCCESS],
            ),
        )
So you could have a sensor that will monitor the refresh of your DBT model (job status sensor or asset sensor) and if there's a new run for the specific tag, request a run for the job that contains your op. I think you could use the run's
run_id
as the RunRequest
run_key
so you don't request your op to run more than once for the same run.
g
The meta tag is part of the dbt manifest node https://docs.getdbt.com/reference/resource-configs/meta
n
Ok, so not a Dagster tag. Then you'd need a way to retrieve the DBT asset's meta field in the context of a sensor.