Skip to content

Commit

Permalink
feat: dbt asset ignore conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
cbini committed Jan 28, 2025
1 parent 58f0dbb commit ec0e01c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
14 changes: 14 additions & 0 deletions src/dbt/kipptaf/models/people/properties.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,17 @@ models:
data_tests:
- unique
- not_null
- name: base_people__staff_roster_history
meta:
dagster:
automation_condition:
ignore:
keys:
- kipptaf/surveys/int_surveys__staff_information_survey_pivot
- name: int_people__staff_roster_history
meta:
dagster:
automation_condition:
ignore:
keys:
- kipptaf/surveys/int_surveys__staff_information_survey_pivot
9 changes: 7 additions & 2 deletions src/teamster/libraries/dbt/dagster_dbt_translator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Any, Mapping

from dagster import AssetKey, AutomationCondition
from dagster import AssetKey, AssetSelection, AutomationCondition
from dagster_dbt import DagsterDbtTranslator, DagsterDbtTranslatorSettings


Expand Down Expand Up @@ -46,7 +46,12 @@ def get_automation_condition(
)
else:
return (
AutomationCondition.eager() | AutomationCondition.code_version_changed()
AutomationCondition.eager().ignore(
AssetSelection.keys(
*automation_condition_config.get("ignore", {}).get("keys", {})
)
)
| AutomationCondition.code_version_changed()
)

def get_group_name(self, dbt_resource_props: Mapping[str, Any]) -> str | None:
Expand Down

0 comments on commit ec0e01c

Please sign in to comment.