HomeElementl

Make instance_ref optional on SensorExecutionContext to enable…

Description

Make instance_ref optional on SensorExecutionContext to enable build_sensor_context() without instance

Summary: Making instance_ref optional allows us to not require build_sensor_context() to have an instance attached. This is a lot cleaner from the perspective of docs. The instance is never used in get_execution_data, and will only ever be None in the testing context. Added an error message to be explicit.

Test Plan: Added more unit tests for coverage

Reviewers: sandyryza, prha

Reviewed By: sandyryza

Differential Revision: https://dagster.phacility.com/D8082