Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[da] Update initial_evaluation condition to only detect partitions_def changes #28764

Conversation

OwenKephart
Copy link
Contributor

Summary & Motivation

This is actually more aligned with the purpose of this condition, as you could imagine having an unpartitioned asset with AutomationCondition.eager() being turned into a static-partitioned asset with 100s of partitions and experiencing the bad behavior of all partitions updating.

It's also more accurate that this is the "initial_evaluation" of those partitions in this case.

How I Tested These Changes

Changelog

The AutomationCondition.initial_evaluation condition has been updated to become true for all partitions of an asset whenever the PartitionsDefinition of that asset changes, rather than whenever the structure of the condition changes.

Copy link
Contributor Author

OwenKephart commented Mar 26, 2025

@OwenKephart OwenKephart requested a review from gibsondan March 26, 2025 17:09
@OwenKephart OwenKephart force-pushed the 03-26-_da_update_initial_evaluation_condition_to_only_detect_partitions_def_changes branch from 0f24812 to 1bf7067 Compare March 26, 2025 17:13
@OwenKephart OwenKephart force-pushed the 03-26-_da_remove_assetselection_information_from_depscondition_checkscondition branch 2 times, most recently from 0f162e3 to e15f221 Compare March 26, 2025 17:39
@OwenKephart OwenKephart force-pushed the 03-26-_da_update_initial_evaluation_condition_to_only_detect_partitions_def_changes branch 2 times, most recently from 9fb6c5f to bcfbae2 Compare March 26, 2025 17:46
@OwenKephart OwenKephart force-pushed the 03-26-_da_remove_assetselection_information_from_depscondition_checkscondition branch from e15f221 to 82a0ba9 Compare March 26, 2025 17:54
@OwenKephart OwenKephart force-pushed the 03-26-_da_update_initial_evaluation_condition_to_only_detect_partitions_def_changes branch 2 times, most recently from 1806c05 to b1d71f3 Compare March 26, 2025 17:55
@OwenKephart OwenKephart force-pushed the 03-26-_da_remove_assetselection_information_from_depscondition_checkscondition branch from 82a0ba9 to 4bcd8ad Compare March 26, 2025 17:55
condition_tree_id = context.root_context.condition.get_unique_id()
if context.previous_true_subset is None or condition_tree_id != context.cursor:
if self._is_initial_evaluation(context):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to sanity check - there is no risk of this firing incorrectly since we are making the rule strictly more permissive.

If you had previously changed just the parittions definition of the asset and nothing else, would this rule have fired? (i.e. would that have impacted the condition_tree_id)?

@@ -68,11 +69,14 @@ def _result_iter(r):
return initial_evaluation_result.true_subset.size


def test_update_on_condition_change() -> None:
@pytest.mark.parametrize("pd_change", [True, False])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit this is a strange acronym choice :)

Copy link
Contributor Author

OwenKephart commented Mar 26, 2025

Merge activity

  • Mar 26, 2:38 PM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Mar 26, 2:42 PM EDT: Graphite rebased this pull request as part of a merge.
  • Mar 26, 2:43 PM EDT: A user merged this pull request with Graphite.

@OwenKephart OwenKephart changed the base branch from 03-26-_da_remove_assetselection_information_from_depscondition_checkscondition to graphite-base/28764 March 26, 2025 18:38
@OwenKephart OwenKephart changed the base branch from graphite-base/28764 to master March 26, 2025 18:40
@OwenKephart OwenKephart force-pushed the 03-26-_da_update_initial_evaluation_condition_to_only_detect_partitions_def_changes branch from b1d71f3 to e8d9cae Compare March 26, 2025 18:41
@OwenKephart OwenKephart merged commit d21abfb into master Mar 26, 2025
4 of 5 checks passed
@OwenKephart OwenKephart deleted the 03-26-_da_update_initial_evaluation_condition_to_only_detect_partitions_def_changes branch March 26, 2025 18:43
gibsondan pushed a commit that referenced this pull request Mar 26, 2025
…f changes (#28764)

## Summary & Motivation

This is actually more aligned with the purpose of this condition, as you could imagine having an unpartitioned asset with `AutomationCondition.eager()` being turned into a static-partitioned asset with 100s of partitions and experiencing the bad behavior of all partitions updating.

It's also more accurate that this is the "initial_evaluation" of those partitions in this case.

## How I Tested These Changes

## Changelog

The `AutomationCondition.initial_evaluation` condition has been updated to become true for all partitions of an asset whenever the PartitionsDefinition of that asset changes, rather than whenever the structure of the condition changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants