Skip to content

Commit

Permalink
Try setting queue enabled for Python notebook jobs (#856)
Browse files Browse the repository at this point in the history
  • Loading branch information
benc-db committed Nov 26, 2024
1 parent bc10666 commit 356c7b2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
### Fixes

- Replace array indexing with 'get' in split_part so as not to raise exception when indexing beyond bounds ([839](https://github.com/databricks/dbt-databricks/pull/839))
- Set queue enabled for Python notebook jobs ([856](https://github.com/databricks/dbt-databricks/pull/856))

### Under the Hood

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ def compile(self, path: str) -> PythonJobDetails:
if access_control_list:
job_spec["access_control_list"] = access_control_list

job_spec["queue"] = {"enabled": True}
return PythonJobDetails(
run_name=self.run_name, job_spec=job_spec, additional_job_config=additional_job_config
)
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/python/test_python_job_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ def test_compile__empty_configs(self, client, permission_builder, parsed_model,
"notebook_path": "path",
},
"libraries": [],
"queue": {"enabled": True},
}
assert details.additional_job_config == {}

Expand All @@ -182,5 +183,6 @@ def test_compile__nonempty_configs(self, client, permission_builder, parsed_mode
"cluster_id": "id",
"libraries": [{"pypi": {"package": "foo"}}],
"access_control_list": [{"user_name": "user", "permission_level": "IS_OWNER"}],
"queue": {"enabled": True},
}
assert details.additional_job_config == {"foo": "bar"}

0 comments on commit 356c7b2

Please sign in to comment.