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

Giovanni Paolo

06/27/2023, 2:29 PM
is it possible to have a weekly asset have its partitions named as '20230618_20230624', i.e. including the date range?
🤖 1
s

sean

06/27/2023, 2:34 PM
Hi Giovanni, I think you can achieve this by passing the
fmt
parameter of
WeeklyPartitionsDefinition
. This parameter is passed to
datetime.strptime
.
g

Giovanni Paolo

06/27/2023, 2:35 PM
but how do I differentiate partition start and end dates in the formatting string?
my understanding is that
fmt
is for parsing the
start_date
in the definition
not the final asset key (.e.g in disk my_partitioned_asset/2023-06-01.pkl)
I want 2023-06-01_2023-06-07.pkl, for example
s

sean

06/27/2023, 2:38 PM
Ah you know what I’m looking at the code now and I can see you’re right-- we’re using the same
fmt
parameter for
strptime
and
strftime
. So I don’t think this is possible at present, but I think it is functionality that could be added (an optional partition key formatting parameter), though unlikely to be prioritized. If you’re interested, would you mind opening a GH issue for it? https://github.com/dagster-io/dagster/issues
g

Giovanni Paolo

06/27/2023, 2:39 PM
sure! i'll open an issue thank you
just so that I get the name right and make it clear in the feature request, what's the proper name of that?
asset output key?
s

sean

06/27/2023, 2:42 PM
“partition key” is the right name-- “asset key” is a separate concept. Though rereading your messages, if you only care about the name under which it is saved on disk, you can do this with a custom IO manager.
❤️ 1
g

Giovanni Paolo

06/27/2023, 2:44 PM
got it! thank you