https://dagster.io/ logo
#dagster-support
Title
# dagster-support
d

Dean Morin

01/03/2023, 5:14 PM
How do I create a partitioned config that’s less than 1 hour? I have a job that I want to run for every 10 minute interval. I’ve seen some mentions of using a
PartitionedConfig
, and some of using
TimeWindowPartitionsDefinition
, are either of these what I should be using?
c

claire

01/03/2023, 9:15 PM
Hi Dean. For op-based jobs, I would use
PartitionedConfig
. For asset-based jobs, I would use a
PartitionsDefinition
. The
TimeWindowPartitionsDefinition
has a
cron_schedule
field in the constructor that you can provide an every-10-minutes cron schedule for. If you wanted to build a
PartitionedConfig
object, you'd have to build your own object similar to `daily_partitioned_config` that accepts your custom
TImeWindowPartitionsDefinition
.
d

Dean Morin

01/03/2023, 10:40 PM
Thanks Claire! Just so I understand, I’ll need to use both objects to achieve a custom partition interval?
c

claire

01/04/2023, 12:21 AM
If you're using assets, you'll just need to define a
TimeWindowPartitionsDefinition
with a cron schedule. If you're using ops, you'll need to create the same
TimeWindowPartitionsDefinition
as above, and create the
PartitionedConfig
object using the partitions definition object.
d

Dean Morin

01/04/2023, 12:49 AM
🍻 I’ll give that a shot and see where I get to. I don’t suppose there are any examples of this you could point me to?
c

claire

01/04/2023, 12:50 AM
I don't have any examples on hand of creating a partitioned config, but here's one that creates a custom `TimeWindowPartitionsDefinition`: https://github.com/dagster-io/dagster/blob/662077b661cf241f7b0b31bdc1cb61f8b000997[…]/dagster_tests/definitions_tests/test_time_window_partitions.py
thank you box 1
5 Views