microsoft / farmvibes-ai

FarmVibes.AI: Multi-Modal GeoSpatial ML Models for Agriculture and Sustainability

Home Page:https://microsoft.github.io/farmvibes-ai/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error deleting a Workflow

sscaglia opened this issue · comments

commented

Hello:

I 'm able to cancel a workflow using run.cancel() and this works fine.

I also tried deleting a workflow using run.delete() but it returns an error "object has no attribute 'delete'". According to documentation, this can be used to delete a complete workflow. It's current status is 'cancelled'.

What could be the issue?

Thanks

Hi, @sscaglia. Thank you for raising this issue.

Could you provide a code snippet or a reproducible example?

The error "object has no attribute 'delete'" might mean that you are trying to use the delete method of an object that is not a VibeWorkflowRun. Another possibility is to use the method delete_run from the client, passing a run_id as argument. Below you can see two examples:

from vibe_core.client import get_default_vibe_client
client = get_default_vibe_client()

# for this example, we will get the last executed run
run_id = client.list_runs()[-1]

# deleting with the client
client.delete_run(run_id)

# or getting the run object and deleting it
run = client.get_run_by_id(run_id)
run.delete()
commented

Hello:

I deleted the notebook, but I was doing something like:

from vibe_core.client import get_default_vibe_client
client = get_default_vibe_client()

# get a list of runs
print(client.list_runs())

# delete the run that failed
run = client.get_run_by_id('run-id')
run.delete()

Again, run.cancel() worked fine.

I couldn't replicate the error on my end. I tried:

  • Getting a run (with client.get_run_by_id('run-id')), which had a done status, and deleting it.
  • Deleting a run with cancelled status.
  • Cancelling a deleted run has no effect, as intended.

All of above worked fine on my end.

Please, let me know if you are able to reproduce that on your end and, if so, share a reproducible example so I can diagnose that.

Closing this issue for now. @sscaglia please, feel free to reopen it if your problem persists.