@Marvin it's possible to use the Python code to get a block ID using the block name?
m
Marvin
08/20/2024, 9:49 AM
To get a block ID using the block name in Python, you can load the block using the combination of the block type slug and the block name (referred to as the block slug). Then, you can access the block's ID.
Here is a code example:
Copy code
python
from prefect.blocks.core import Block
# Load the block using the block slug in the format 'block-type/block-name'
block_slug = "json/life-the-universe-everything"
block = Block.load(block_slug)
# Access the block ID
block_id = block.id
print(f"The block ID is: {block_id}")
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.