Can you launch a RunRequest
while creating partition keys for a DynamicPartition
#18283
-
Hi! The question was originally asked in Dagster Slack. |
Beta Was this translation helpful? Give feedback.
Answered by
clairelin135
Nov 27, 2023
Replies: 1 comment
-
Yes, it is possible. Here's an example: stations_partition = DynamicPartitionsDefinition(name="stations")
@asset(partitions_def=stations_partition)
def my_asset():
...
@sensor(asset_selection=AssetSelection.keys(my_asset.key))
def stations_sensor(context):
stations = ["1", "2", "3"]
return SensorResult(
run_requests=[RunRequest(run_key=None, tags={ASSET_PARTITION_RANGE_START_TAG: "1", ASSET_PARTITION_RANGE_END_TAG: "3"})],
dynamic_partitions_requests=[stations_partition.build_add_request(stations)],
) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
clairelin135
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, it is possible. Here's an example: