Dataform on landing
A scheduling rule that runs the Dataform actions with one tag when the tables they read are updated.
Use it when Tagged Dataform actions should run as soon as their sources are updated.
- name: DWH refresh on source change
priority: 3
status: active
description: Triggers DWH rebuild when source tables are updated
code_id: dwh/source-change-event
applies_to:
node_type: DataformAction
tags:
- dwh_rebuild
when:
events:
- origin: ancestors
types: data_updated
ancestor_depth: direct
then:
target:
same_as_applies_to: false
node_type: DataformAction
tags:
- dwh_rebuild
scope: descendants
do:
kind: single
action:
type: dataform_run
parameters:
release: projects/acme-data-{ENV}/locations/europe-west1/repositories/acme-dwh/releaseConfigs/release-daily
retry_number: 2
Taken from examples/rules-repo/rules/example_event_rule.yaml
The rule applies to the Dataform actions tagged dwh_rebuild and listens for events on their direct ancestors. When a
source table is updated, it starts a Dataform workflow invocation from the release configuration. retry_number: 2 is
the older spelling of max_retries: 2, which newer rules put under parameters.retry.
{ENV} becomes the environment's name when the rule is evaluated. Keep the file in a repository, check it with
nistor rules validate, and push it with nistor rules sync. A synced rule is locked: change the file, not the rule.