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

Alec Koumjian

01/25/2023, 4:55 PM
Defining my first partitioned asset. Other than the
context.partition_key
is there anything else to pull from to get the partition definitely? For example, if I'm using
MonthlyPartitionsDefinition
, the
partition_key
will be a YYYY-MM-DD string but it would be convenient if there were some data available in the context to give me an actual range. Of course, I can calculate the end of the month in my code but if it's already available it would be great to use.
t

Thomas Rolfsnes

02/06/2023, 2:38 PM
Hi! I'm using the following snippet to get start/end timestamp/dates. Note that these are pendulum datetime objects.
Copy code
if context.has_asset_partitions:
    start, end = context.asset_partitions_time_window