diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a58b1c9..e12a3b19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,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 diff --git a/dbt/adapters/databricks/python_models/python_submissions.py b/dbt/adapters/databricks/python_models/python_submissions.py index 27e4303c..5f0f7653 100644 --- a/dbt/adapters/databricks/python_models/python_submissions.py +++ b/dbt/adapters/databricks/python_models/python_submissions.py @@ -224,6 +224,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(self.run_name, job_spec, additional_job_config) diff --git a/tests/unit/python/test_python_job_support.py b/tests/unit/python/test_python_job_support.py index 4eec7355..41f48041 100644 --- a/tests/unit/python/test_python_job_support.py +++ b/tests/unit/python/test_python_job_support.py @@ -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 == {} @@ -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"}