diff --git a/python_modules/dagster/dagster/_core/definitions/time_window_partitions.py b/python_modules/dagster/dagster/_core/definitions/time_window_partitions.py index 32d9f4565d89f..396c46baa289b 100644 --- a/python_modules/dagster/dagster/_core/definitions/time_window_partitions.py +++ b/python_modules/dagster/dagster/_core/definitions/time_window_partitions.py @@ -734,7 +734,7 @@ def less_than(self, partition_key1: str, partition_key2: str) -> bool: @property def partitions_subset_class(self) -> Type["PartitionsSubset"]: - return UnresolvedTimeWindowPartitionsSubset + return TimePartitionKeyPartitionsSubset def empty_subset(self) -> "PartitionsSubset": return self.partitions_subset_class.empty_subset(self) @@ -1647,7 +1647,7 @@ def __eq__(self, other): ) -class UnresolvedTimeWindowPartitionsSubset(BaseTimeWindowPartitionsSubset): +class TimePartitionKeyPartitionsSubset(BaseTimeWindowPartitionsSubset): def __init__( self, partitions_def: TimeWindowPartitionsDefinition, @@ -1664,7 +1664,7 @@ def with_partition_keys( self, partition_keys: Iterable[str] ) -> "BaseTimeWindowPartitionsSubset": new_partitions = {*(self._included_partition_keys or []), *partition_keys} - return UnresolvedTimeWindowPartitionsSubset( + return TimePartitionKeyPartitionsSubset( self._partitions_def, included_partition_keys=new_partitions, ) @@ -1744,10 +1744,10 @@ def __contains__(self, partition_key: str) -> bool: def __eq__(self, other): return ( - isinstance(other, UnresolvedTimeWindowPartitionsSubset) + isinstance(other, TimePartitionKeyPartitionsSubset) and self.partitions_def == other.partitions_def and self._included_partition_keys == other._included_partition_keys - ) or super(UnresolvedTimeWindowPartitionsSubset, self).__eq__(other) + ) or super(TimePartitionKeyPartitionsSubset, self).__eq__(other) @classmethod def empty_subset(cls, partitions_def: PartitionsDefinition) -> "PartitionsSubset": @@ -1764,7 +1764,7 @@ def with_partitions_def( "num_partitions would become inaccurate if the partitions_defs had different cron" " schedules", ) - return UnresolvedTimeWindowPartitionsSubset( + return TimePartitionKeyPartitionsSubset( partitions_def=partitions_def, included_partition_keys=self._included_partition_keys, ) diff --git a/python_modules/dagster/dagster_tests/asset_defs_tests/test_partitions_subset.py b/python_modules/dagster/dagster_tests/asset_defs_tests/test_partitions_subset.py index 1d7696e0ca92d..104215fa886f1 100644 --- a/python_modules/dagster/dagster_tests/asset_defs_tests/test_partitions_subset.py +++ b/python_modules/dagster/dagster_tests/asset_defs_tests/test_partitions_subset.py @@ -3,8 +3,8 @@ from dagster._core.definitions.multi_dimensional_partitions import MultiPartitionsSubset from dagster._core.definitions.partition import DefaultPartitionsSubset from dagster._core.definitions.time_window_partitions import ( + TimePartitionKeyPartitionsSubset, TimeWindowPartitionsSubset, - UnresolvedTimeWindowPartitionsSubset, ) from dagster._core.errors import DagsterInvalidDeserializationVersionError @@ -78,4 +78,4 @@ def test_get_subset_type(): def test_empty_subsets(): assert type(composite.empty_subset()) is MultiPartitionsSubset assert type(static_partitions.empty_subset()) is DefaultPartitionsSubset - assert type(time_window_partitions.empty_subset()) is UnresolvedTimeWindowPartitionsSubset + assert type(time_window_partitions.empty_subset()) is TimePartitionKeyPartitionsSubset diff --git a/python_modules/dagster/dagster_tests/definitions_tests/test_time_window_partitions.py b/python_modules/dagster/dagster_tests/definitions_tests/test_time_window_partitions.py index db418ad82f189..1f57f1ec08918 100644 --- a/python_modules/dagster/dagster_tests/definitions_tests/test_time_window_partitions.py +++ b/python_modules/dagster/dagster_tests/definitions_tests/test_time_window_partitions.py @@ -21,9 +21,9 @@ from dagster._core.definitions.time_window_partitions import ( BaseTimeWindowPartitionsSubset, ScheduleType, + TimePartitionKeyPartitionsSubset, TimeWindow, TimeWindowPartitionsSubset, - UnresolvedTimeWindowPartitionsSubset, ) from dagster._seven.compat.pendulum import create_pendulum_time from dagster._utils.partitions import DEFAULT_HOURLY_FORMAT_WITHOUT_TIMEZONE @@ -745,7 +745,7 @@ def test_start_not_aligned(): @pytest.mark.parametrize( "partitions_subset_class", - [UnresolvedTimeWindowPartitionsSubset, TimeWindowPartitionsSubset], + [TimePartitionKeyPartitionsSubset, TimeWindowPartitionsSubset], ) @pytest.mark.parametrize( "case_str", @@ -822,7 +822,7 @@ def test_time_partitions_subset_identical_serialization(): @pytest.mark.parametrize( "partitions_subset_class", - [UnresolvedTimeWindowPartitionsSubset, TimeWindowPartitionsSubset], + [TimePartitionKeyPartitionsSubset, TimeWindowPartitionsSubset], ) @pytest.mark.parametrize( "initial, added",