-
I'm trying to use the new experimental partition APIs, but it appears that some of the arguments that the old APIs include aren't carried forwards, which makes it harder to adapt the partitions to different timing. Specifically, I'm trying to use @monthly_partitioned_config, but I cannot access the current month. With the previous API you could set Setup: @graph
def example_graph():
pass
@monthly_partitioned_config(start_date="2021-08-01")
def monthly_config(start, _end):
return {}
job = example_graph.to_job(config=monthly_config)
mode = job.get_default_mode()
partition_def = mode.get_partition_set_def(job.name) If I try to access the current month, I get an exception. >>> partition = partition_def.get_partition(name="2021-09-01")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/conda/lib/python3.9/site-packages/dagster/core/definitions/partition.py", line 411, in get_partition
check.failed("Partition name {} not found!".format(name))
File "/opt/conda/lib/python3.9/site-packages/dagster/check/__init__.py", line 119, in failed
raise CheckError("Failure condition: {desc}".format(desc=desc))
dagster.check.CheckError: Failure condition: Partition name 2021-09-01 not found! If I try to access the previous month, then it works fine: >>> partition = partition_def.get_partition(name="2021-08-01")
>>> partition
<dagster.core.definitions.partition.Partition object at 0x7f5f9106f280> In this case I'm using the partition with a sensor instead of as a sensor as I don't control the upstream data, instead I'm triggering as data becomes available and aggregating all of the currently available for the current month. Is there a way to adapt the experimental partition APIs to allow access to the current month? (or future! I may have some forecasting data I'm working with soon that can 'backfill' dates ahead...) This is with 0.12.8. >>> dagster.__version__
'0.12.8' |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
@abkfenris - do your partitions represent time windows? If so, does the time window for the partition that you want to be named "2021-08-01" end on 8/1 or begin on 8/1? |
Beta Was this translation helpful? Give feedback.
@abkfenris - do your partitions represent time windows? If so, does the time window for the partition that you want to be named "2021-08-01" end on 8/1 or begin on 8/1?