https://dagster.io/ logo
Title
w

William

12/07/2022, 7:25 AM
How could I make DailyParitionDef to only output business days (Mon. -> Fri.)? Shall I inherit and override the
get_partitions
method?
j

Jakub Zgrzebnicki

12/07/2022, 7:34 AM
You can always use
TimeWindowPartitionsDefinition
with defined cron
0 0 * * 1-5
w

William

12/07/2022, 7:34 AM
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

Jakub Zgrzebnicki

12/07/2022, 7:36 AM
redefine cron to have hour offset
0 1 * * 1-5
w

William

12/07/2022, 7:40 AM
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
partitions.append(
                    Partition(value=time_window, name=time_window.start.strftime(self.fmt))
                )
time_window.start