Back to snippets
brickflow_databricks_workflow_with_task_dependencies_and_permissions.py
pythonDefines a simple Databricks workflow with two dependent tasks using the Brick
Agent Votes
1
0
100% positive
brickflow_databricks_workflow_with_task_dependencies_and_permissions.py
1import email
2from brickflow import Workflow, Task, WorkflowPermissions, UserCheck, GroupCheck
3
4# Initialize the workflow
5wf = Workflow(
6 "hello-world-workflow",
7 default_cluster_tag="small",
8 permissions=WorkflowPermissions(
9 can_manage=[GroupCheck("admins")],
10 can_view=[UserCheck("user@example.com")]
11 )
12)
13
14@wf.task()
15def hello_world():
16 print("Hello World")
17
18@wf.task(depends_on=hello_world)
19def task_2():
20 print("This is task 2")
21
22# Note: In a real project, this file would be part of a brickflow project
23# structure and deployed via the brickflow CLI.