run request for 3 new locations
This commit is contained in:
@@ -39,9 +39,10 @@ def list_locations(context: dg.SensorEvaluationContext) -> dg.SensorResult:
|
||||
if new_locations:
|
||||
context.log.info(f"Discovered {len(new_locations)} new locations.")
|
||||
|
||||
# Limit to 3 new locations
|
||||
return dg.SensorResult(
|
||||
run_requests=[],
|
||||
run_requests=[
|
||||
dg.RunRequest(partition_key=location) for location in new_locations[:3]
|
||||
],
|
||||
dynamic_partitions_requests=[
|
||||
location_partitions_def.build_add_request(new_locations),
|
||||
latitude_partitions_def.build_add_request(new_latitudes),
|
||||
|
||||
Reference in New Issue
Block a user