38
38
from dagster ._core .definitions .freshness_policy import FreshnessPolicy
39
39
from dagster ._core .definitions .metadata import ArbitraryMetadataMapping
40
40
from dagster ._core .definitions .multi_dimensional_partitions import MultiPartitionsDefinition
41
- from dagster ._core .definitions .new_freshness_policy import NewFreshnessPolicy
42
41
from dagster ._core .definitions .node_definition import NodeDefinition
43
42
from dagster ._core .definitions .op_definition import OpDefinition
44
43
from dagster ._core .definitions .op_invocation import direct_invocation_result
@@ -103,7 +102,6 @@ class AssetsDefinition(ResourceAddable, IHasInternalInit):
103
102
"asset_deps" ,
104
103
"owners_by_key" ,
105
104
"partitions_def" ,
106
- "new_freshness_policy_by_key" ,
107
105
}
108
106
109
107
# partition mappings are also tracked inside the AssetSpecs, but this enables faster access by
@@ -152,7 +150,6 @@ def __init__(
152
150
auto_materialize_policies_by_key : Optional [Mapping [AssetKey , AutoMaterializePolicy ]] = None ,
153
151
# if adding new fields, make sure to handle them in the with_attributes, from_graph,
154
152
# from_op, and get_attributes_dict methods
155
- new_freshness_policy_by_key : Optional [Mapping [AssetKey , NewFreshnessPolicy ]] = None ,
156
153
):
157
154
from dagster ._core .definitions .graph_definition import GraphDefinition
158
155
from dagster ._core .execution .build_resources import wrap_resources_for_execution
@@ -241,7 +238,6 @@ def __init__(
241
238
check .invariant (partition_mappings is None )
242
239
check .invariant (asset_deps is None )
243
240
check .invariant (partitions_def is None )
244
- check .invariant (new_freshness_policy_by_key is None )
245
241
resolved_specs = specs
246
242
247
243
else :
@@ -282,7 +278,6 @@ def __init__(
282
278
descriptions_by_key = descriptions_by_key ,
283
279
code_versions_by_key = None ,
284
280
partitions_def = partitions_def ,
285
- new_freshness_policy_by_key = new_freshness_policy_by_key ,
286
281
)
287
282
288
283
normalized_specs : list [AssetSpec ] = []
@@ -406,7 +401,6 @@ def __call__(self, *args: object, **kwargs: object) -> object:
406
401
407
402
@public
408
403
@beta_param (param = "resource_defs" )
409
- @beta_param (param = "new_freshness_policy_by_output_name" )
410
404
@staticmethod
411
405
def from_graph (
412
406
graph_def : "GraphDefinition" ,
@@ -436,9 +430,6 @@ def from_graph(
436
430
auto_materialize_policies_by_output_name : Optional [
437
431
Mapping [str , Optional [AutoMaterializePolicy ]]
438
432
] = None ,
439
- new_freshness_policy_by_output_name : Optional [
440
- Mapping [str , Optional [NewFreshnessPolicy ]]
441
- ] = None ,
442
433
) -> "AssetsDefinition" :
443
434
"""Constructs an AssetsDefinition from a GraphDefinition.
444
435
@@ -497,10 +488,6 @@ def from_graph(
497
488
backfill_policy (Optional[BackfillPolicy]): Defines this asset's BackfillPolicy
498
489
owners_by_key (Optional[Mapping[AssetKey, Sequence[str]]]): Defines
499
490
owners to be associated with each of the asset keys for this node.
500
- new_freshness_policy_by_output_name (Optional[Mapping[str, Optional[NewFreshnessPolicy]]]): Defines asset
501
- freshness conditions to be associated with some or all of the output assets for this node.
502
- Currently experimental, it is intended to replace the existing, deprecated `FreshnessPolicy` construct.
503
- For now, continue to use freshness checks to define asset freshness.
504
491
"""
505
492
return AssetsDefinition ._from_node (
506
493
node_def = graph_def ,
@@ -526,7 +513,6 @@ def from_graph(
526
513
check_specs = check_specs ,
527
514
owners_by_output_name = owners_by_output_name ,
528
515
code_versions_by_output_name = code_versions_by_output_name ,
529
- new_freshness_policy_by_output_name = new_freshness_policy_by_output_name ,
530
516
)
531
517
532
518
@public
@@ -655,9 +641,6 @@ def _from_node(
655
641
can_subset : bool = False ,
656
642
check_specs : Optional [Sequence [AssetCheckSpec ]] = None ,
657
643
owners_by_output_name : Optional [Mapping [str , Sequence [str ]]] = None ,
658
- new_freshness_policy_by_output_name : Optional [
659
- Mapping [str , Optional [NewFreshnessPolicy ]]
660
- ] = None ,
661
644
) -> "AssetsDefinition" :
662
645
from dagster ._core .definitions .decorators .decorator_assets_definition_builder import (
663
646
_validate_check_specs_target_relevant_asset_keys ,
@@ -762,9 +745,6 @@ def _output_dict_to_asset_dict(
762
745
descriptions_by_key = _output_dict_to_asset_dict (descriptions_by_output_name ),
763
746
code_versions_by_key = _output_dict_to_asset_dict (code_versions_by_output_name ),
764
747
partitions_def = partitions_def ,
765
- new_freshness_policy_by_key = _output_dict_to_asset_dict (
766
- new_freshness_policy_by_output_name
767
- ),
768
748
)
769
749
770
750
return AssetsDefinition .dagster_internal_init (
@@ -1728,7 +1708,6 @@ def _asset_specs_from_attr_key_params(
1728
1708
descriptions_by_key : Optional [Mapping [AssetKey , str ]],
1729
1709
owners_by_key : Optional [Mapping [AssetKey , Sequence [str ]]],
1730
1710
partitions_def : Optional [PartitionsDefinition ],
1731
- new_freshness_policy_by_key : Optional [Mapping [AssetKey , NewFreshnessPolicy ]],
1732
1711
) -> Sequence [AssetSpec ]:
1733
1712
validated_group_names_by_key = check .opt_mapping_param (
1734
1713
group_names_by_key , "group_names_by_key" , key_type = AssetKey , value_type = str
@@ -1764,13 +1743,6 @@ def _asset_specs_from_attr_key_params(
1764
1743
value_type = AutomationCondition ,
1765
1744
)
1766
1745
1767
- validated_new_freshness_policy_by_key = check .opt_mapping_param (
1768
- new_freshness_policy_by_key ,
1769
- "new_freshness_policy_by_key" ,
1770
- key_type = AssetKey ,
1771
- value_type = NewFreshnessPolicy ,
1772
- )
1773
-
1774
1746
validated_owners_by_key = check .opt_mapping_param (
1775
1747
owners_by_key , "owners_by_key" , key_type = AssetKey , value_type = list
1776
1748
)
@@ -1812,7 +1784,6 @@ def _asset_specs_from_attr_key_params(
1812
1784
partitions_def = check .opt_inst_param (
1813
1785
partitions_def , "partitions_def" , PartitionsDefinition
1814
1786
),
1815
- new_freshness_policy = validated_new_freshness_policy_by_key .get (key ),
1816
1787
)
1817
1788
)
1818
1789
0 commit comments