Skip to content

Commit c43e303

Browse files
committed
mark as beta/experimental
1 parent 4378dda commit c43e303

File tree

8 files changed

+23
-8
lines changed

8 files changed

+23
-8
lines changed

python_modules/dagster/dagster/_core/definitions/asset_graph.py

+1
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ def execution_set_entity_keys(self) -> AbstractSet[EntityKey]:
157157

158158
@property
159159
def new_freshness_policy(self) -> Optional[NewFreshnessPolicy]:
160+
"""Experimental, do not use."""
160161
return self._spec.new_freshness_policy
161162

162163
##### ASSET GRAPH SPECIFIC INTERFACE

python_modules/dagster/dagster/_core/definitions/asset_out.py

+1
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ def kinds(self) -> Optional[set[str]]:
212212

213213
@property
214214
def new_freshness_policy(self) -> Optional[NewFreshnessPolicy]:
215+
"""Experimental, do not use."""
215216
return self._spec.new_freshness_policy
216217

217218
def to_out(self) -> Out:

python_modules/dagster/dagster/_core/definitions/asset_spec.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import dagster._check as check
1717
from dagster._annotations import (
1818
PublicAttr,
19+
beta_param,
1920
hidden_param,
2021
only_allow_hidden_params_in_kwargs,
2122
public,
@@ -99,6 +100,10 @@ def validate_kind_tags(kinds: Optional[AbstractSet[str]]) -> None:
99100
raise DagsterInvalidDefinitionError("Assets can have at most three kinds currently.")
100101

101102

103+
@beta_param(
104+
param="new_freshness_policy",
105+
additional_warn_text="Currently experimental. Use freshness checks instead to define asset freshness.",
106+
)
102107
@hidden_param(
103108
param="freshness_policy",
104109
breaking_version="1.10.0",
@@ -141,7 +146,7 @@ class AssetSpec(IHasInternalInit, IHaveNew, LegacyNamedTupleMixin):
141146
will be made visible in the Dagster UI.
142147
partitions_def (Optional[PartitionsDefinition]): Defines the set of partition keys that
143148
compose the asset.
144-
new_freshness_policy (Optional[NewFreshnessPolicy]): A condition that delineates when an asset is considered fresh. Use this over `freshness_policy`.
149+
new_freshness_policy (Optional[NewFreshnessPolicy]): A condition that delineates when an asset is considered fresh. Currently experimental.
145150
"""
146151

147152
key: PublicAttr[AssetKey]
@@ -302,6 +307,7 @@ def with_io_manager_key(self, io_manager_key: str) -> "AssetSpec":
302307
)
303308

304309
@public
310+
@beta_param(param="new_freshness_policy", additional_warn_text="Currently experimental.")
305311
def replace_attributes(
306312
self,
307313
*,

python_modules/dagster/dagster/_core/definitions/assets.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ class AssetsDefinition(ResourceAddable, IHasInternalInit):
115115
_computation: Optional[AssetGraphComputation]
116116

117117
@beta_param(param="execution_type")
118+
@beta_param(param="new_freshness_policy_by_key")
118119
def __init__(
119120
self,
120121
*,
@@ -406,6 +407,7 @@ def __call__(self, *args: object, **kwargs: object) -> object:
406407

407408
@public
408409
@beta_param(param="resource_defs")
410+
@beta_param(param="new_freshness_policy_by_key")
409411
@staticmethod
410412
def from_graph(
411413
graph_def: "GraphDefinition",
@@ -498,7 +500,8 @@ def from_graph(
498500
owners to be associated with each of the asset keys for this node.
499501
new_freshness_policy_by_output_name (Optional[Mapping[str, Optional[NewFreshnessPolicy]]]): Defines asset
500502
freshness conditions to be associated with some or all of the output assets for this node.
501-
This is intended to replace the existing, deprecated `FreshnessPolicy` construct.
503+
Currently experimental, it is intended to replace the existing, deprecated `FreshnessPolicy` construct.
504+
For now, continue to use freshness checks to define asset freshness.
502505
"""
503506
return AssetsDefinition._from_node(
504507
node_def=graph_def,

python_modules/dagster/dagster/_core/definitions/decorators/asset_decorator.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,7 @@ def asset(
253253
pool (Optional[str]): A string that identifies the concurrency pool that governs this asset's execution.
254254
non_argument_deps (Optional[Union[Set[AssetKey], Set[str]]]): Deprecated, use deps instead.
255255
Set of asset keys that are upstream dependencies, but do not pass an input to the asset.
256-
Hidden parameter not exposed in the decorator signature, but passed in kwargs.
257-
new_freshness_policy (Optional[NewFreshnessPolicy]): A condition that must be met for an asset to be considered fresh.
256+
Hidden parameter not exposed in the decorator signature, but passed in kwargs. Currently experimental.
258257
259258
Examples:
260259
.. code-block:: python
@@ -710,7 +709,7 @@ def my_function(asset0):
710709
decorator_name="@multi_asset",
711710
execution_type=AssetExecutionType.MATERIALIZATION,
712711
pool=pool,
713-
new_freshness_policy=None, # TODO enable new_freshness_policy for @multi_asset
712+
new_freshness_policy=None,
714713
)
715714

716715
def inner(fn: Callable[..., Any]) -> AssetsDefinition:

python_modules/dagster/dagster/_core/definitions/freshness.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
from enum import Enum
22
from typing import NamedTuple
33

4+
from dagster._annotations import beta
45
from dagster._core.definitions.asset_key import AssetKey
56
from dagster._serdes import whitelist_for_serdes
67

78

8-
# TODO finalize states and naming
9-
# https://dagsterlabs.slack.com/archives/C047L6H0LF4/p1743697967200509
9+
@beta
1010
@whitelist_for_serdes
1111
class FreshnessState(str, Enum):
1212
PASSING = "PASSING"
@@ -15,6 +15,7 @@ class FreshnessState(str, Enum):
1515
UNKNOWN = "UNKNOWN"
1616

1717

18+
@beta
1819
@whitelist_for_serdes
1920
class FreshnessStateEvaluation(
2021
NamedTuple(

python_modules/dagster/dagster/_core/definitions/new_freshness_policy.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from typing import Optional
44

55
from dagster import _check as check
6+
from dagster._annotations import beta
67
from dagster._record import IHaveNew, record_custom
78
from dagster._serdes import whitelist_for_serdes
89

@@ -27,10 +28,11 @@ class NewFreshnessPolicy(ABC):
2728
def policy_type(self) -> FreshnessPolicyType: ...
2829

2930

31+
@beta
3032
@whitelist_for_serdes
3133
@record_custom
3234
class TimeWindowFreshnessPolicy(NewFreshnessPolicy, IHaveNew):
33-
"""A freshness condition that considers an asset fresh if it was materialized within a specified time window (time_window_minutes).
35+
"""[BETA/EXPERIMENTAL] A freshness condition that considers an asset fresh if it was materialized within a specified time window (time_window_minutes).
3436
3537
The asset is considered stale if its last materialization is older than time_window_minutes, and in a warning state
3638
if its last materialization is older than the warning time window but newer than the critical time window.

python_modules/dagster/dagster/_core/definitions/remote_asset_graph.py

+2
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def job_names(self) -> Sequence[str]:
130130

131131
@property
132132
def new_freshness_policy(self) -> Optional[NewFreshnessPolicy]:
133+
"""Experimental, do not use."""
133134
return self.resolve_to_singular_repo_scoped_node().asset_node_snap.new_freshness_policy
134135

135136

@@ -206,6 +207,7 @@ def pools(self) -> Optional[set[str]]:
206207

207208
@property
208209
def new_freshness_policy(self) -> Optional[NewFreshnessPolicy]:
210+
"""Experimental, do not use."""
209211
return self.asset_node_snap.new_freshness_policy
210212

211213

0 commit comments

Comments
 (0)