Michel Rouly
06/16/2021, 7:03 PM@sensor
, and I have the same function (copy/paste) passed into an explicit SensorDefinition
call as the evaluation_fn
.
But the decorated function is working, whereas the SensorDefinition
instance I'm constructing is not doing anything. Specifically, it sets up and runs as a sensor, but it's not invoking the evaluation_fn
as far as I can tell.
Any idea what I need to do before calling SensorDefinition
if I'm not able to use @sensor
? Would be super helpful 🙂daniel
06/16/2021, 7:04 PMMichel Rouly
06/16/2021, 7:05 PM@sensor(
name="update_clustering_sensor",
pipeline_name="update_clustering_pipeline",
mode="s3",
minimum_interval_seconds=10,
)
def decorated_sensor(context: SensorExecutionContext) -> Generator:
print("decorated_sensor")
yield SkipReason("No solids were added or updated.")
def build_sensor(mode: str) -> SensorDefinition:
return SensorDefinition(
name="update_clustering_sensor",
pipeline_name="update_clustering_pipeline",
mode=mode,
minimum_interval_seconds=30,
evaluation_fn=sensor_fn,
)
def sensor_fn(context: SensorExecutionContext) -> Generator:
print("sensor_fn")
yield SkipReason("No solids were added or updated.")
Something like this.mode
as I've done in build_sensor
.sensor_fn
printed out during sensor execution.daniel
06/16/2021, 7:08 PMupdate_clustering_sensor_fn
should be sensor_fn
?Michel Rouly
06/16/2021, 7:08 PMdaniel
06/16/2021, 7:10 PMbuild_sensor()
(with parens) where you had decorated_sensor
(without parens) before?Michel Rouly
06/16/2021, 7:10 PMprha
06/16/2021, 7:12 PMMichel Rouly
06/16/2021, 7:12 PM@sensor
that may be relevant? There's also the decorated_fn
field in SensorDefinition
that @sensor
parameterizes, but I'm not.daniel
06/16/2021, 7:13 PMMichel Rouly
06/16/2021, 7:18 PM@sensor
that used to work back in our repo definition, we're just actually not even seeing ticks anymore. Something strange is afoot. Will update.daniel
06/16/2021, 7:22 PMMichel Rouly
06/16/2021, 7:25 PM2021-06-16 15:24:39 - BackfillDaemon - INFO - No backfill jobs requested.
2021-06-16 15:24:39 - SchedulerDaemon - INFO - Not checking for any runs since no schedules have been started.
$DAGSTER_HOME
and restarted the daemon and dagit and our sensor is back to working.@sensor
$DAGSTER_HOME
a second time, our SensorDefinition
based sensor is working as expected.SensorDefinition
directly does work, but either that or simply having multiple sensors of the same names active at different times (i.e., not concurrently) may corrupt the $DAGSTER_HOME
directory?prha
06/16/2021, 7:35 PMschedule_storage
? sqlite? postgres?Michel Rouly
06/16/2021, 7:35 PMprha
06/16/2021, 7:43 PMSensorDefinition
version successfully without blowing away dagster home or even restarting the daemonMichel Rouly
06/16/2021, 7:46 PM$DAGSTER_HOME
directory if analysis on that would be helpful, we backed it up before blowing it away