我试图使用SmartSensors实现ExternalTaskSensor,但由于它使用execution_date
来戳其他DAG状态,我似乎无法通过它,如果我从SmartExternalSensor中省略它,它会说有一个KeyError
和执行日期,因为它不存在
我试图重写get_poke_context
方法
def get_poke_context(self, context):
result = super().get_poke_context(context)
if self.execution_date is None:
result['execution_date'] = context['execution_date']
return result
但它现在表示datetime对象不可json序列化(这是在使用json.dumps将传感器注册为SmartSensor时完成的),并作为普通传感器运行。如果我直接传递datetime对象的字符串,它表示str object has no isoformat() method
,因此我知道执行日期必须是datetime对象
你们知道怎么解决这个问题吗
目前没有回答
相关问题 更多 >
编程相关推荐