dagster icon indicating copy to clipboard operation
dagster copied to clipboard

[DS][x/n] Create ChildCondition condition

Open OwenKephart opened this issue 9 months ago • 1 comments

Summary & Motivation

Going to leave this as a draft for a bit.

This creates a condition which resolves to the union of any conditions set on a child.

The implementation as it is right now should change, but there is a bit of complication involved in the recursive case. Essentially, imagine you have the following setup (A -> B -> C):

A's condition: SchedulingCondition.child_condition()

B's condition: SchedulingCondition.child_condition() | SchedulingCondition.foo()

C's condition: SchedulingCondition.bar()

I think it's pretty natural to expect that A's condition would end up resolving to the result bar() | foo(). However, this would mean that we'd need some concept of a "resolved form" of B's condition so that we don't end up in a situation where we just do a naive copy of B's condition, resulting in child_condition() | foo(), which resolves to child_condition() | foo() | foo(), and so on.

This resolving operation would need to happen arbitrarily deep within a top-level condition, which means we'd need some method like with_resolved_child_condtions(). All of this seemed like a fairly large amount of machinery for a prototype PR, and the only additional ability it would enable would be the possibility of nesting these child_conditions in broader expressions.

I do think that is a useful ability, and so I think that design space should be explored in the future, but for now I think it's sufficient to just make it "illegal" to combine child_condition with any of the existing operands.

How I Tested These Changes

OwenKephart avatar May 07 '24 21:05 OwenKephart

[!WARNING] This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite. Learn more

  • #21705 Graphite 👈
  • #21671 Graphite: 1 other dependent PR (#21737 Graphite)
  • #21641 Graphite: 1 other dependent PR (#21670 Graphite)
  • #21640 Graphite
  • #21648 Graphite
  • #21615 Graphite
  • #21613 Graphite
  • #21612 Graphite
  • #21573 Graphite
  • #21546 Graphite
  • #21545 Graphite
  • #21541 Graphite
  • #21540 Graphite
  • #21539 Graphite
  • #21538 Graphite
  • #21537 Graphite
  • #21536 Graphite
  • #21535 Graphite
  • #21521 Graphite
  • #21520 Graphite
  • #21511 Graphite: 1 other dependent PR (#21512 Graphite)
  • #21510 Graphite
  • #21508 Graphite
  • #21507 Graphite
  • #21505 Graphite
  • #21504 Graphite
  • #21503 Graphite
  • #21502 Graphite
  • #21501 Graphite
  • #21500 Graphite
  • #21499 Graphite
  • master

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @OwenKephart and the rest of your teammates on Graphite Graphite

OwenKephart avatar May 07 '24 21:05 OwenKephart