How can I config a sensor and start it with python api? #3555
Replies: 1 comment 1 reply
-
Hi - using a factory to create sensors seems like a very reasonable option to me. The @sensor decorator is just a wrapper that creates a SensorDefinition (https://docs.dagster.io/_apidocs/schedules-sensors#dagster.SensorDefinition) - you can absolutely write your own function that creates such a definition dynamically, the resulting SensorDefinition just needs to be included in your repository. As long as you know the name of your sensor, it doesn't matter if it's created statically in code or dynamically from a factory - you can start it either from dagit or using the |
Beta Was this translation helpful? Give feedback.
-
How can I config a sensor and start it with python api?
f.e. I want to define a directory_sensor:
But how to config the MY_DIRECTORY and other_args dynamically?
If I use a factory to programmatically generate sensor , how start it with python api?
Beta Was this translation helpful? Give feedback.
All reactions