Nike-Inc / brickflow

Pythonic Programming Framework to orchestrate jobs in Databricks Workflow
https://engineering.nike.com/brickflow/
Apache License 2.0
183 stars 36 forks source link

TaskDependencySensor: do not fail if upstream failed / derive execution time from context #132

Closed maxim-mityutko closed 2 months ago

maxim-mityutko commented 2 months ago

Description

These changes are in line with the reasoning that's described in #101.

  1. Make sensor results repeatable if workflow is restarted by using the execution_date which is derived from Brickflow context and not the current time. This ensures that relative delta between the workflow run (based on it's schedule) and the upstream DAG run always stays the same.
  2. Sensor will always poke upstream, unless timeout is reached. This ensure that if upstream is failed or running, or in some other state, the sensor will continue waiting for the success (by default)

Related Issue

101

Motivation and Context

Improve sensor stability and simplify workflow reruns.

How Has This Been Tested?

Unit tests + this code had been overriding the original sensor and running in production pipelines

Screenshots (if appropriate):

Types of changes

Checklist: