Page MenuHomeElementl

Sensor invocation, remove evaluate_tick from API docs, change testing story
ClosedPublic

Authored by cdecarolis on Thu, Jun 3, 9:06 PM.

Details

Summary

This diff changes away from using evaluate_tick for testing sensors, and instead supports direct sensor invocation for sensors created via a decorator.

I left decorated_fn optional for backcompat with people who defined sensors using constructor. How do we want to support SensorDefinitions created from constructor? Should we default to evaluation_fn if decorated_fn is not provided?

Test Plan

Unit tests + docs build

Screen Shot 2021-06-04 at 11.22.04 AM.png (597×872 px, 91 KB)

Screen Shot 2021-06-04 at 11.22.17 AM.png (915×910 px, 161 KB)

Diff Detail

Repository
R1 dagster
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

cdecarolis retitled this revision from Sensor invocaiton, remove evaluate_tick from API docs, change testing story to Sensor invocation, remove evaluate_tick from API docs, change testing story.Thu, Jun 3, 9:11 PM
cdecarolis edited the test plan for this revision. (Show Details)
examples/docs_snippets/docs_snippets/concepts/partitions_schedules_sensors/sensors/sensors.py
57

It's awkward that we're building a sensor context, but not using it. Would it make sense to make the sensor context arg optional?

examples/docs_snippets/docs_snippets/concepts/partitions_schedules_sensors/sensors/sensors.py
57

Would it make sense to make the sensor context arg optional?

I think so, did we do it for resource yet? I know we didn't enforce strict name rules on these but since its just 0 / 1 arg i thiiiiink we will be ok?

Update docs to reflect optionality of context arg on sensor invocation

Do we want to make the context arg itself optional when defining the sensor function?

Do we want to make the context arg itself optional when defining the sensor function?

probably. I think that's a follow up diff tho

follow up diff tho

im cool with that

This revision is now accepted and ready to land.Tue, Jun 8, 4:47 PM