def execute(self, context):
     hook = MLEngineHook(gcp_conn_id=self._gcp_conn_id,
                         delegate_to=self._delegate_to)
     if self._operation == 'create':
         return hook.create_model(self._project_id, self._model)
     elif self._operation == 'get':
         return hook.get_model(self._project_id, self._model['name'])
     else:
         raise ValueError('Unknown operation: {}'.format(self._operation))
Esempio n. 2
0
 def execute(self, context):
     hook = MLEngineHook(gcp_conn_id=self._gcp_conn_id,
                         delegate_to=self._delegate_to)
     return hook.create_model(project_id=self._project_id,
                              model=self._model)