Skip to content
Discussion options

You must be logged in to vote

There are a couple options for creating partitions on business days:

  1. Create a TimeWindowPartitionsDefinition with a cron schedule of 0 0 * * 1-5, which creates a partition for Monday through Friday at 00:00.
  2. The approach above works if all Monday through Friday days are valid. But if you want to take holidays into account too, you can define a DynamicPartitionsDefinition (currently experimental) and create a partition for each business day. For example:
business_days = DynamicPartitionsDefinition(name="business_days")


@op
def add_business_day_partition(context):
    yesterday = date.today() - timedelta(days=1)
    if is_business_day(yesterday):
        context.instance.add_dynamic_par…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by clairelin135
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
area: partitions Related to Partitions
2 participants