forked from SocialFinanceDigitalLabs/liia-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First working sensor. NOTE: May trigger sufficiency pipeline more tha…
…n once at the moment
- Loading branch information
Showing
6 changed files
with
38 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
|
||
from dagster import op | ||
|
||
|
||
@op | ||
def ons_area(): | ||
create_dimONSArea() | ||
create_dimONSArea() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,17 @@ | ||
from dagster import RunRequest, run_status_sensor, sensor, DagsterRunStatus, RunConfig, DefaultSensorStatus | ||
|
||
from dagster import RunRequest, RunsFilter, DagsterRunStatus, sensor | ||
from liiatools_pipeline.jobs.ssda903 import ssda903_incoming | ||
from liiatools_pipeline.jobs.sufficiency_903 import ssda903_sufficiency | ||
|
||
''' | ||
@run_status_sensor( | ||
run_status=DagsterRunStatus.SUCCESS, | ||
description="Adds in ONS and census data once 903 pipeline completes", | ||
request_job=ssda903_incoming, | ||
) | ||
@sensor( | ||
job=ssda903_sufficiency, | ||
minimum_interval_seconds=300, | ||
default_status=DefaultSensorStatus.RUNNING, | ||
) | ||
|
||
@sensor(job=ssda903_sufficiency) | ||
def sufficiency_sensor(context): | ||
yield RunRequest( | ||
run_key=None, | ||
run_config=RunConfig(), | ||
)''' | ||
run_records = context.instance.get_run_records( | ||
filters=RunsFilter( | ||
job_name=ssda903_incoming.name, | ||
statuses=[DagsterRunStatus.SUCCESS], | ||
), | ||
order_by="update_timestamp", | ||
ascending=False, | ||
) | ||
for run_record in run_records: | ||
yield RunRequest(run_key=run_record.dagster_run.run_id) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters