is it possible to have a weekly asset have its par...
# ask-community
g
is it possible to have a weekly asset have its partitions named as '20230618_20230624', i.e. including the date range?
🤖 1
s
Hi Giovanni, I think you can achieve this by passing the
fmt
parameter of
WeeklyPartitionsDefinition
. This parameter is passed to
datetime.strptime
.
g
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
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
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
“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
got it! thank you