What's the best approach to handling holidays in a...
# ask-community
n
What's the best approach to handling holidays in a partitioned asset? I created an asset like the following below, should I raise an exception on a holiday? or have it pass along a bool?
Copy code
@asset(partitions_def=my_partitions_def)
def fed_holiday(context) -> bool:
    return is_fed_holiday(context.partition_key)
o
hi! what are you trying to accomplish here? what assets are you imagining to be downstream of this, and how will they use this information?
n
Essentially on a holiday I want everything downstream NOT to run
o
would you want those downstream assets to ever fill in partitions for those holidays (i.e. on the next non-holiday day, those partitions would get filled in), or would you want those to remain blank forever?
in general, I think I'd handle this more in the scheduling layer -- creating a custom ScheduleDefinition with a
should_execute
function that detects if it's a federal holiday
n
Only for the holiday I want it not to run, so the next non-holiday I want it to run
o
got it -- i wouldn't represent this as an asset, I'd just handle not kicking off runs for those dates in the schedule layer
n
Sounds good thanks