https://prefect.io logo
Title
s

Sunjay

12/08/2022, 2:17 PM
Hi Team, I created a custom block with some functionality an registered the block on the UI. I made a few changes to the block and registered this block again but I am still seeing old functionality. So is there a way to delete an existing block from the workspace or to overwrite an existing block.(custom block)
2
m

Mike Grabbe

12/08/2022, 2:23 PM
The simplest potential fix is to try saving the block with
overwrite=True
The full line would be:
block.save("my-block-name", overwrite=True)
you could also delete the block before creating it anew. You could do this in the cli like this:
prefect block type delete your-block-type-slug
🙌 2
s

Sunjay

12/08/2022, 2:36 PM
perfect, thanks Mike
m

Mike Grabbe

12/08/2022, 2:37 PM
happy to help
:gratitude-thank-you: 1
j

Jean-Michel Provencher

12/23/2022, 7:17 PM
is it normal that the overwrite=True parameter does not seem to update block attributes?
FYI, if the block was created with an older prefect version, when upgrading to 2.7.4, the changes will not be applied properly when overwriting. If the block was created with 2.7.4, the overwrite works.
m

Mike Grabbe

12/23/2022, 7:22 PM
What kind of block are you working with?
j

Jean-Michel Provencher

12/23/2022, 7:22 PM
custom block
I upgraded and deleted the block so it works, but it's the kind of bug than can be bad if it happens again in the future (thinking the overwrite will overwrite the attributes) but it does not. At least with the latest version it works 🙂
1