Riccardo Tesselli
04/12/2023, 2:16 PMTim Castillo
04/12/2023, 10:27 PMstate:modified+ --full-refresh
, etc.) and another workflow for updating your data on a schedule?
Having the workflows in separate locations (your CI/CD tool or Dagster) causes an issue in which Dagster won't know your data is up-to-date if you have a separate dbt run on CD triggered externally.
For Dagster to know the state of your data and update your dbt models on CD, have you thought of triggering a run via the GraphQL API?
If you can do a dbt ls --select state:modified+
, then you can get a list of the models/assets that need to be updated. and then pass those assets into a GraphQL query like this:
mutation LaunchAdHocRunMutation (
$repositoryName:String!
) {
launchRun(
executionParams:{
selector:{
repositoryName: $repositoryName
assetSelection: "changed_source*"
}
}
)
}
That's not a working GraphQL query, but it gets the message across. HEre are some resources on the GraphQL API and the asset selection syntax