How could I make DailyParitionDef to only output b...
# ask-community
w
How could I make DailyParitionDef to only output business days (Mon. -> Fri.)? Shall I inherit and override the
get_partitions
method?
j
You can always use
TimeWindowPartitionsDefinition
with defined cron
0 0 * * 1-5
w
Thanks for your reply Jakub!
One follow up question is I seem cannot define hour_offset to a negative number
Currently day parition 2022-12-05 represents time window 12/05 + hour_offset to 12/06 + hour_offset
How could I make 2022-12-05 partition represents 12/04+hour_offset -> 12/05+hour_offset?
j
redefine cron to have hour offset
0 1 * * 1-5
w
Cool I've successfully defined that by passing cron_schedule
daggy success 1
in terms of partition.name it seems the TimeWindowParitionDef hard-codes to use
Copy code
partitions.append(
                    Partition(value=time_window, name=time_window.start.strftime(self.fmt))
                )
time_window.start