Skip to content

Commit

Permalink
Update proj-to-bundle method to include trigger. (#130)
Browse files Browse the repository at this point in the history
* Update proj-to-bundle method to include trigger.

* Add Tests and run MAKE FMT, COV

* updating dependencies (#129)

(cherry picked from commit 372db6e)

---------

Co-authored-by: suarzac <[email protected]>
Co-authored-by: Ashok Singamaneni <[email protected]>
  • Loading branch information
3 people authored Jun 6, 2024
1 parent 372db6e commit 8986064
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 5 deletions.
4 changes: 3 additions & 1 deletion brickflow/cli/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
class BrickflowProject(BaseModel):
name: str
path_from_repo_root_to_project_root: str = "." # used for mono repo
path_project_root_to_workflows_dir: str # used for repos with multiple batches of workflows
path_project_root_to_workflows_dir: (
str # used for repos with multiple batches of workflows
)
deployment_mode: str = BrickflowDeployMode.BUNDLE.value
brickflow_version: str = DEFAULT_BRICKFLOW_VERSION_MODE
enable_plugins: bool = False
Expand Down
1 change: 1 addition & 0 deletions brickflow/codegen/databricks_bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,7 @@ def proj_to_bundle(self) -> DatabricksAssetBundles:
email_notifications=workflow.email_notifications,
notification_settings=workflow.notification_settings,
webhook_notifications=workflow.webhook_notifications,
trigger=workflow.trigger,
)
jobs[workflow_name] = job

Expand Down
6 changes: 5 additions & 1 deletion tests/codegen/expected_bundles/dev_bundle_monorepo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ targets:
notification_settings: null
webhook_notifications: null
timeout_seconds: null
health:
health:
rules:
- metric: "RUN_DURATION_SECONDS"
op: "GREATER_THAN"
value: 7200.0
trigger:
pause_status: UNPAUSED
file_arrival:
url: <my_url>
git_source:
git_commit: a
git_provider: github
Expand Down
6 changes: 5 additions & 1 deletion tests/codegen/expected_bundles/dev_bundle_polyrepo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ targets:
notification_settings: null
webhook_notifications: null
timeout_seconds: null
health:
health:
rules:
- metric: "RUN_DURATION_SECONDS"
op: "GREATER_THAN"
value: 7200.0
trigger:
pause_status: UNPAUSED
file_arrival:
url: <my_url>
git_source:
git_commit: a
git_provider: github
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ targets:
some_wf:
email_notifications: null
health: null
trigger: null
git_source:
git_commit: a
git_provider: github
Expand Down Expand Up @@ -76,6 +77,10 @@ targets:
- metric: "RUN_DURATION_SECONDS"
op: "GREATER_THAN"
value: 7200.0
trigger:
pause_status: UNPAUSED
file_arrival:
url: <my_url>
git_source:
git_commit: a
git_provider: github
Expand Down
6 changes: 5 additions & 1 deletion tests/codegen/expected_bundles/local_bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ targets:
notification_settings: null
webhook_notifications: null
timeout_seconds: null
health:
health:
rules:
- metric: "RUN_DURATION_SECONDS"
op: "GREATER_THAN"
value: 7200.0
trigger:
pause_status: UNPAUSED
file_arrival:
url: <my_url>
git_source: null
job_clusters: []
max_concurrent_runs: 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ targets:
notification_settings: null
webhook_notifications: null
timeout_seconds: null
health:
health:
rules:
- metric: "RUN_DURATION_SECONDS"
op: "GREATER_THAN"
value: 7200.0
trigger:
pause_status: UNPAUSED
file_arrival:
url: <my_url>
git_source: null
job_clusters: []
max_concurrent_runs: 1.0
Expand Down
4 changes: 4 additions & 0 deletions tests/codegen/sample_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
{"metric": "RUN_DURATION_SECONDS", "op": "GREATER_THAN", "value": 7200.0}
]
}, # type: ignore
trigger={
"file_arrival": {"url": "<my_url>"},
"pause_status": "UNPAUSED",
}, # type: ignore
)


Expand Down

0 comments on commit 8986064

Please sign in to comment.