Binoy Shah
08/28/2023, 2:08 PMSensorResult
and RunRequest
• RunRequest
https://github.com/dagster-io/dagster/blob/master/python_modules/dagster/dagster/_core/definitions/run_request.py#L110:L111 Says RunRequest to be returned from @sensor
it would be nice if what the partition_key
argument does in https://github.com/dagster-io/dagster/blob/master/python_modules/dagster/dagster/_core/definitions/run_request.py#L130
• SensorResult
https://github.com/dagster-io/dagster/blob/master/python_modules/dagster/dagster/_core/definitions/run_request.py#L358:L370 also talks about it as return from sensor evaluation, and it has dynamic partition awareness
Yet there are no examples of SensorResult and searching docs on https://docs.dagster.io/ gives only the Python Doc of API
Appreciate if some clarification of its purpose and differences is provided? When to use SensorResult
vs when to use RunRequest
Tim Castillo
08/28/2023, 3:05 PMSensorResult
is something that came out with 1.4 and haven't caught up on the documentation for it yet.
SensorResult
s are a simplified wrapper to put all of your sensor-related side effects into one place. It combines everything that's made from a sensor: run requests, cursor updates, and skip reasons.
So rather than `yield`ing your RunRequests
with each new one, and updating your cursor somewhere else, you also have the option to return one SensorResult
at the end.
afaik, it's mainly a convenience class and you can skip using it if you don't want it. but I'll let someone from the team correct me if I'm wrong.Binoy Shah
08/28/2023, 4:02 PMpartition_key
behave in the RunRequest
?