How do I create a partitioned config that’s less t...
# ask-community
d
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
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
Thanks Claire! Just so I understand, I’ll need to use both objects to achieve a custom partition interval?
c
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
🍻 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
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