https://dagster.io/ logo
#ask-community
Title
# ask-community
z

Zach

06/23/2022, 9:30 PM
can anyone point me to an example of a partitioned asset job? I'm looking at https://docs.dagster.io/concepts/partitions-schedules-sensors/partitions#partitioned-asset-job but it's unclear to me how to access the start/end times of the partition window within the asset - or maybe I have a more fundamental misunderstanding of how they're supposed to work?
🤖 1
s

sandy

06/23/2022, 11:58 PM
You can get the start and end of the window as datetimes too. E.g.
Copy code
def handle_output(self, context, obj):
    start, end = context.asset_partitions_time_window
❤️ 1
z

Zach

06/24/2022, 12:12 AM
awesome, thanks! is there an example you can point me to of how to then materialize a partition from a custom IOManager?
I'm just a bit confused about what you need to specify in the asset materialization to indicate what partitions are being materialized
s

sandy

06/24/2022, 12:13 AM
with software-defined assets, you don't need to explicitly yield any asset materializations
if you have a daily-partitioned asset, and, from dagit, you kick off a materialization for for may 5 1990, an asset materialization will automatically be produced for that partition
does that answer your question?
z

Zach

06/24/2022, 12:16 AM
yeah I think so, for some reason I thought if I was using a custom IOManager I'd have to manually specify the partition -somewhere in the docs it specifically stated that the default IOManager did this so I thought it'd be behavior I'd have to replicate in a custom IOManager. But it sounds like that's all handled for me, which is pretty sweet
s

sandy

06/24/2022, 12:16 AM
ah - yeah, that's not necessary
z

Zach

06/24/2022, 12:17 AM
great, thanks a bunch!!
s

sandy

06/24/2022, 12:17 AM
if you come across those docs, mind sending them my way so I can try to clarify them?
z

Zach

06/24/2022, 12:18 AM
sure, it's here, underneath the first code example: "When an asset is partitioned, the default IO manager stores each partition in a separate file, all underneath a directory whose location is based on the asset's key."
it's a bit fair because it's explaining a code example using the default IO Manager
s

sandy

06/24/2022, 12:20 AM
ah, got it - we should probably just have an example of writing a custom partitioned IO manager
4 Views