scaffold sensor triggered html download
This commit is contained in:
15
apps/stocks/src/sensors.py
Normal file
15
apps/stocks/src/sensors.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from collections.abc import Iterator
|
||||
from datetime import date
|
||||
|
||||
import jobs
|
||||
|
||||
import dagster as dg
|
||||
|
||||
|
||||
@dg.sensor(job=jobs.raw_html_job)
|
||||
def check_update(context: dg.SensorEvaluationContext) -> Iterator[dg.RunRequest]:
|
||||
ic(context.cursor)
|
||||
|
||||
yield dg.RunRequest()
|
||||
|
||||
context.update_cursor(date.today().strftime("%Y-%m-%d"))
|
||||
Reference in New Issue
Block a user