Ashwin Kamath
05/18/2023, 1:31 AMKate Ross
05/18/2023, 8:46 AMAshwin Kamath
05/18/2023, 4:11 PMclaire
05/18/2023, 4:42 PMclaire
05/18/2023, 4:49 PMIdentityPartitionMapping
. So whatever keys are select for the upstream asset are also selected for the downstream asset, and vice versa.
Do you happen to have asset defs that I'd be able to repro this with?Kate Ross
05/18/2023, 7:37 PMclaire
05/18/2023, 7:43 PMKate Ross
05/18/2023, 7:44 PMAshwin Kamath
05/18/2023, 7:45 PMAshwin Kamath
05/18/2023, 7:46 PMAshwin Kamath
05/18/2023, 7:46 PMclaire
05/18/2023, 7:47 PM@asset(
partitions_def=partitions_def,
ins={"asset1": AssetIn(partition_mapping=<Your partition mapping def here>},
)
def downstream_asset1(asset1):
return 2
Ashwin Kamath
05/18/2023, 7:47 PMAshwin Kamath
05/18/2023, 7:47 PMAshwin Kamath
05/18/2023, 7:47 PMclaire
05/18/2023, 7:49 PMAshwin Kamath
05/18/2023, 7:50 PMAshwin Kamath
05/18/2023, 9:08 PM################## REPRODUCTION STEPS ##################
#
# 1. Run `dagster dev -f partition_mapping.py`
# 2. Open dashboard in browser.
# 3. Wait for sensor to kick in and materialize all partitions of upstream_asset.
# 4. Trigger a backfill of downstream_asset via "Materialize selected.." on the Asset graph.
# 5. Go to backfill page at http://.../overview/backfills.
# 6. Click failure button to see "Nonexistent partition keys:" error.
#
# NOTE: Triggering the backfill from the `downstream_job` page results in a successful backfill.
# It only fails from the asset page itself.
#
########################################################
Ashwin Kamath
05/18/2023, 9:08 PMAshwin Kamath
05/18/2023, 9:09 PMclaire
05/19/2023, 12:32 AMTimeWindowPartitionMapping
TimeWindowPartitionsDefinition
, and use that as your upstream asset partitions def instead of a DynamicPartitionsDefinition
.Ashwin Kamath
05/19/2023, 3:03 AMAshwin Kamath
05/19/2023, 3:20 AMTimeWIndowPartitionMapping
makes sense. The behavior I'm seeing right now is due to the default IdentityPartitionMapping
chosen here - https://github.com/dagster-io/dagster/blob/98bc51c47d4c6e4e8a6e2f40e232ebf066e8c7e[…]_modules/dagster/dagster/_core/definitions/partition_mapping.pyAshwin Kamath
05/19/2023, 3:20 AMAshwin Kamath
05/22/2023, 7:41 PMclaire
05/22/2023, 9:34 PMTimeWindowPartitionMapping
, i meant TimeWindowPartitionsDefinition
. I don't have personal experience doing something like this, but one possible implementation strategy would have an "exclude_days" arg in the constructor.claire
05/22/2023, 9:40 PMAshwin Kamath
05/31/2023, 2:18 PMexclude_days
or dynamic partition mapping. I do need something reasonably quickly so will try to dig deeper into the dagster internalsAshwin Kamath
05/31/2023, 2:18 PM