diff --git a/CHANGELOG.md b/CHANGELOG.md index bcfe5b19..79ee57d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,4 @@ -<<<<<<< HEAD ## dbt-databricks 1.10.0 (TBD) -======= -## dbt-databricks 1.9.3 (TBD) - -### Under the Hood - -- Collapsing to a single connection manager (since the old one no longer works) ([910](https://github.com/databricks/dbt-databricks/pull/910)) - -## dbt-databricks 1.9.2 (Jan 21, 2024) ->>>>>>> 395801ec (Compress to one connection manager (#910)) ### Features diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 8aca86e5..00000000 --- a/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -databricks-sql-connector>=3.4.0, <3.5.0 -dbt-spark~=1.8.0 -dbt-core>=1.9.0b1, <2.0 -dbt-common>=1.10.0, <2.0 -dbt-adapters>=1.7.0, <2.0 -databricks-sdk==0.36.0 -keyring>=23.13.0 -protobuf<5.0.0 diff --git a/setup.py b/setup.py deleted file mode 100644 index 340f6ff7..00000000 --- a/setup.py +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -# require python 3.8 or newer -if sys.version_info < (3, 8): - print("Error: dbt does not support this version of Python.") - print("Please upgrade to Python 3.8 or higher.") - sys.exit(1) - - -# require version of setuptools that supports find_namespace_packages -from setuptools import setup - -try: - from setuptools import find_namespace_packages -except ImportError: - # the user has a downlevel version of setuptools. - print("Error: dbt requires setuptools v40.1.0 or higher.") - print('Please upgrade setuptools with "pip install --upgrade setuptools" and try again') - sys.exit(1) - - -# pull long description from README -this_directory = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(this_directory, "README.md"), "r", encoding="utf8") as f: - long_description = f.read() - - -# get this package's version from dbt/adapters//__version__.py -def _get_plugin_version() -> str: - _version_path = os.path.join(this_directory, "dbt", "adapters", "databricks", "__version__.py") - try: - exec(open(_version_path).read()) - return locals()["version"] - except IOError: - print("Failed to load dbt-databricks version file for packaging.", file=sys.stderr) - sys.exit(-1) - - -package_name = "dbt-databricks" -package_version = _get_plugin_version() -description = """The Databricks adapter plugin for dbt""" - -setup( - name=package_name, - version=package_version, - description=description, - long_description=long_description, - long_description_content_type="text/markdown", - author="Databricks", - author_email="feedback@databricks.com", - url="https://github.com/databricks/dbt-databricks", - packages=find_namespace_packages(include=["dbt", "dbt.*"]), - include_package_data=True, - install_requires=[ - "dbt-spark>=1.8.0, <2.0", - "dbt-core>=1.9.0b1, <2.0", - "dbt-adapters>=1.7.0, <2.0", - "dbt-common>=1.10.0, <2.0", - "databricks-sql-connector>=3.4.0, <3.5.0", - "databricks-sdk==0.36.0", - "keyring>=23.13.0", - "pandas<2.2.0", - "protobuf<5.0.0", - "pydantic~=2.7.0", - ], - zip_safe=False, - classifiers=[ - "Development Status :: 5 - Production/Stable", - "License :: OSI Approved :: Apache Software License", - "Operating System :: Microsoft :: Windows", - "Operating System :: MacOS :: MacOS X", - "Operating System :: POSIX :: Linux", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - ], - python_requires=">=3.8", -) diff --git a/tests/unit/python/test_python_submissions.py b/tests/unit/python/test_python_submissions.py deleted file mode 100644 index f84608d3..00000000 --- a/tests/unit/python/test_python_submissions.py +++ /dev/null @@ -1,60 +0,0 @@ -from mock import patch -from dbt.adapters.databricks.credentials import DatabricksCredentials -from dbt.adapters.databricks.python_models.python_submissions import BaseDatabricksHelper - - -# class TestDatabricksPythonSubmissions: -# def test_start_cluster_returns_on_receiving_running_state(self): -# session_mock = Mock() -# # Mock the start command -# post_mock = Mock() -# post_mock.status_code = 200 -# session_mock.post.return_value = post_mock -# # Mock the status command -# get_mock = Mock() -# get_mock.status_code = 200 -# get_mock.json.return_value = {"state": "RUNNING"} -# session_mock.get.return_value = get_mock - -# context = DBContext(Mock(), None, None, session_mock) -# context.start_cluster() - -# session_mock.get.assert_called_once() - - -class DatabricksTestHelper(BaseDatabricksHelper): - def __init__(self, parsed_model: dict, credentials: DatabricksCredentials): - self.parsed_model = parsed_model - self.credentials = credentials - - -@patch("dbt.adapters.databricks.credentials.Config") -class TestAclUpdate: - def test_empty_acl_empty_config(self, _): - helper = DatabricksTestHelper({"config": {}}, DatabricksCredentials()) - assert helper._update_with_acls({}) == {} - - def test_empty_acl_non_empty_config(self, _): - helper = DatabricksTestHelper({"config": {}}, DatabricksCredentials()) - assert helper._update_with_acls({"a": "b"}) == {"a": "b"} - - def test_non_empty_acl_empty_config(self, _): - expected_access_control = { - "access_control_list": [ - {"user_name": "user2", "permission_level": "CAN_VIEW"}, - ] - } - helper = DatabricksTestHelper({"config": expected_access_control}, DatabricksCredentials()) - assert helper._update_with_acls({}) == expected_access_control - - def test_non_empty_acl_non_empty_config(self, _): - expected_access_control = { - "access_control_list": [ - {"user_name": "user2", "permission_level": "CAN_VIEW"}, - ] - } - helper = DatabricksTestHelper({"config": expected_access_control}, DatabricksCredentials()) - assert helper._update_with_acls({"a": "b"}) == { - "a": "b", - "access_control_list": expected_access_control["access_control_list"], - } \ No newline at end of file