This is an automated email from the ASF dual-hosted git repository.
weilee pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new d1efb7425b Adding a test for the init method of the Databricks Base
Hook (#42180)
d1efb7425b is described below
commit d1efb7425b58617a5c43a9bde988f0f0bf816db6
Author: Bonnie Why <[email protected]>
AuthorDate: Thu Sep 19 05:32:14 2024 -0500
Adding a test for the init method of the Databricks Base Hook (#42180)
---
tests/always/test_project_structure.py | 1 -
.../databricks/hooks/test_databricks_base.py | 33 ++++++++++++++++++++++
2 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/tests/always/test_project_structure.py
b/tests/always/test_project_structure.py
index a6d174e639..6cf3329e8e 100644
--- a/tests/always/test_project_structure.py
+++ b/tests/always/test_project_structure.py
@@ -101,7 +101,6 @@ class TestProjectStructure:
"tests/providers/cncf/kubernetes/utils/test_delete_from.py",
"tests/providers/cncf/kubernetes/utils/test_k8s_hashlib_wrapper.py",
"tests/providers/cncf/kubernetes/utils/test_xcom_sidecar.py",
- "tests/providers/databricks/hooks/test_databricks_base.py",
"tests/providers/google/cloud/fs/test_gcs.py",
"tests/providers/google/cloud/links/test_automl.py",
"tests/providers/google/cloud/links/test_base.py",
diff --git a/tests/providers/databricks/hooks/test_databricks_base.py
b/tests/providers/databricks/hooks/test_databricks_base.py
new file mode 100644
index 0000000000..fdc019c1b5
--- /dev/null
+++ b/tests/providers/databricks/hooks/test_databricks_base.py
@@ -0,0 +1,33 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import pytest
+
+from airflow.providers.databricks.hooks.databricks_base import
BaseDatabricksHook
+
+DEFAULT_CONN_ID = "databricks_default"
+
+
+class TestBaseDatabricksHook:
+ def test_init_exception(self):
+ """
+ Tests handling incorrect parameters passed to ``__init__``
+ """
+ with pytest.raises(ValueError, match="Retry limit must be greater than
or equal to 1"):
+ BaseDatabricksHook(databricks_conn_id=DEFAULT_CONN_ID,
retry_limit=0)