Skip to content

Commit

Permalink
make work w multi assets
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiedemaria committed Nov 3, 2023
1 parent 2ab41c8 commit 4a6f1c9
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions python_modules/dagster/dagster/_core/execution/context/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,7 @@ def partition_keys(self) -> Sequence[str]:
partitions_def = DailyPartitionsDefinition("2023-08-20")
@asset(
partitions_def=partitions_def
)
@asset(partitions_def=partitions_def)
def an_asset(context: AssetExecutionContext):
context.log.info(context.partition_keys)
Expand All @@ -347,7 +345,17 @@ def self_dependent_asset(context: AssetExecutionContext, self_dependent_asset):
# running a backfill of the 2023-08-21 through 2023-08-25 partitions of this asset will log:
# ["2023-08-21", "2023-08-22", "2023-08-23", "2023-08-24", "2023-08-25"]
"""
return self.asset_partition_keys_for_output()
key_range = self.partition_key_range
partitions_def = self.assets_def.partitions_def
if partitions_def is None:
raise DagsterInvariantViolationError(
"Cannot access partition_key for a non-partitioned run"
)

return partitions_def.get_partition_keys_in_range(
key_range,
dynamic_partitions_store=self.instance,
)

@deprecated(breaking_version="2.0", additional_warn_text="Use `partition_key_range` instead.")
@public
Expand Down

0 comments on commit 4a6f1c9

Please sign in to comment.