Skip to content

Commit

Permalink
[1.9] Update deprecation warnings for automation_condition, auto_mate…
Browse files Browse the repository at this point in the history
…rialize_policy, and freshness_policy
  • Loading branch information
OwenKephart committed Oct 15, 2024
1 parent 9598b9c commit 6ab1c49
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import TYPE_CHECKING, Any, Iterable, Mapping, NamedTuple, Optional, Sequence, Set

import dagster._check as check
from dagster._annotations import PublicAttr, experimental_param, public
from dagster._annotations import PublicAttr, deprecated_param, experimental_param, public
from dagster._core.definitions.auto_materialize_policy import AutoMaterializePolicy
from dagster._core.definitions.declarative_automation.automation_condition import (
AutomationCondition,
Expand Down Expand Up @@ -73,6 +73,11 @@ class AssetExecutionType(Enum):
@experimental_param(param="owners")
@experimental_param(param="tags")
@experimental_param(param="kinds")
@deprecated_param(
param="freshness_policy",
breaking_version="1.10.0",
additional_warn_text="use freshness checks instead.",
)
class AssetSpec(
NamedTuple(
"_AssetSpec",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def from_automation_condition(
@public
@staticmethod
@deprecated(
breaking_version="1.9",
breaking_version="1.10.0",
additional_warn_text="Use `AutomationCondition.eager()` instead.",
)
def eager(max_materializations_per_minute: Optional[int] = 1) -> "AutoMaterializePolicy":
Expand Down Expand Up @@ -228,7 +228,7 @@ def eager(max_materializations_per_minute: Optional[int] = 1) -> "AutoMaterializ
@public
@staticmethod
@deprecated(
breaking_version="1.9",
breaking_version="1.10.0",
additional_warn_text="Use `AutomationCondition.any_downstream_conditions()` instead.",
)
def lazy(max_materializations_per_minute: Optional[int] = 1) -> "AutoMaterializePolicy":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
Set,
)

from dagster._annotations import deprecated, experimental
from dagster._annotations import experimental
from dagster._core.asset_graph_view.serializable_entity_subset import SerializableEntitySubset
from dagster._core.definitions.auto_materialize_rule import AutoMaterializeRule
from dagster._core.definitions.auto_materialize_rule_evaluation import (
Expand Down Expand Up @@ -52,7 +52,6 @@
)


@deprecated(breaking_version="1.9")
@whitelist_for_serdes
class MaterializeOnRequiredForFreshnessRule(
AutoMaterializeRule, NamedTuple("_MaterializeOnRequiredForFreshnessRule", [])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ def asset(

@experimental_param(param="resource_defs")
@experimental_param(param="io_manager_def")
@experimental_param(param="automation_condition")
@experimental_param(param="backfill_policy")
@experimental_param(param="owners")
@experimental_param(param="tags")
Expand All @@ -117,9 +116,14 @@ def asset(
)
@deprecated_param(
param="auto_materialize_policy",
breaking_version="1.9.0",
breaking_version="1.10.0",
additional_warn_text="use `automation_condition` instead.",
)
@deprecated_param(
param="freshness_policy",
breaking_version="1.10.0",
additional_warn_text="use freshness checks instead.",
)
def asset(
compute_fn: Optional[Callable[..., Any]] = None,
*,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class FreshnessMinutes(NamedTuple):


@deprecated(
breaking_version="1.9",
breaking_version="1.10.0",
additional_warn_text="For monitoring freshness, use freshness checks instead. If using lazy "
"auto-materialize, use AutomationCondition.cron() and AutomationCondition.any_downstream_conditions().",
)
Expand Down

0 comments on commit 6ab1c49

Please sign in to comment.