From 5c28c3580cabd99a52985c0623b9f3b80956831f Mon Sep 17 00:00:00 2001 From: nszoni Date: Mon, 19 Feb 2024 10:53:36 +0100 Subject: [PATCH 01/11] update dev requirements --- dev_requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev_requirements.txt b/dev_requirements.txt index d157a21..9e0e3dd 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -1,9 +1,9 @@ -pytest==7.4.4 -twine==4.0.2 +pytest==8.0.1 +twine==5.0.0 wheel==0.42 pre-commit==3.5.0 pytest-dotenv==0.5.2 -dbt-tests-adapter~=1.7.4 +dbt-tests-adapter~=1.7.8 flaky==3.7.0 pytest-xdist==3.5.0 -e . From 7ae24c9c4cbe0bb6a965c6be37f94fd271a59ae5 Mon Sep 17 00:00:00 2001 From: nszoni Date: Mon, 19 Feb 2024 10:54:35 +0100 Subject: [PATCH 02/11] decouple to common and adapter package in setup --- dbt/adapters/fabric/__version__.py | 2 +- setup.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dbt/adapters/fabric/__version__.py b/dbt/adapters/fabric/__version__.py index 582554e..037ac1f 100644 --- a/dbt/adapters/fabric/__version__.py +++ b/dbt/adapters/fabric/__version__.py @@ -1 +1 @@ -version = "1.7.4" +version = "1.8.0rc1" diff --git a/setup.py b/setup.py index 758eeb6..de4c648 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ package_name = "dbt-fabric" authors_list = ["Pradeep Srikakolapu"] -dbt_version = "1.7" +dbt_version = "1.8" description = """A Microsoft Fabric Synapse Data Warehouse adapter plugin for dbt""" this_directory = os.path.abspath(os.path.dirname(__file__)) @@ -66,9 +66,10 @@ def run(self): packages=find_namespace_packages(include=["dbt", "dbt.*"]), include_package_data=True, install_requires=[ - "dbt-core~=1.7.2", - "pyodbc>=4.0.35,<5.1.0", + "pyodbc>=4.0.35,<5.2.0", "azure-identity>=1.12.0", + "dbt-common~=0.1.5", + "dbt-adapters~=0.1.0a6", ], cmdclass={ "verify": VerifyVersionCommand, From bf2967e97a789740f88063437a33975d15666ab1 Mon Sep 17 00:00:00 2001 From: nszoni Date: Mon, 19 Feb 2024 11:39:14 +0100 Subject: [PATCH 03/11] shift imports --- dbt/adapters/fabric/__init__.py | 2 +- dbt/adapters/fabric/fabric_adapter.py | 19 ++++++++-------- .../fabric/fabric_connection_manager.py | 22 +++++++++---------- dbt/adapters/fabric/fabric_credentials.py | 2 +- tests/functional/adapter/test_dbt_clone.py | 2 +- 5 files changed, 23 insertions(+), 24 deletions(-) diff --git a/dbt/adapters/fabric/__init__.py b/dbt/adapters/fabric/__init__.py index efd0d23..038bd86 100644 --- a/dbt/adapters/fabric/__init__.py +++ b/dbt/adapters/fabric/__init__.py @@ -1,11 +1,11 @@ from dbt.adapters.base import AdapterPlugin +from dbt.adapters.include import fabric from dbt.adapters.fabric.fabric_adapter import FabricAdapter from dbt.adapters.fabric.fabric_column import FabricColumn from dbt.adapters.fabric.fabric_configs import FabricConfigs from dbt.adapters.fabric.fabric_connection_manager import FabricConnectionManager from dbt.adapters.fabric.fabric_credentials import FabricCredentials -from dbt.include import fabric Plugin = AdapterPlugin( adapter=FabricAdapter, diff --git a/dbt/adapters/fabric/fabric_adapter.py b/dbt/adapters/fabric/fabric_adapter.py index 20629a2..4ffdaa9 100644 --- a/dbt/adapters/fabric/fabric_adapter.py +++ b/dbt/adapters/fabric/fabric_adapter.py @@ -1,23 +1,22 @@ from typing import List, Optional import agate -import dbt.exceptions +import dbt_common.exceptions from dbt.adapters.base import Column as BaseColumn - -# from dbt.events.functions import fire_event -# from dbt.events.types import SchemaCreation from dbt.adapters.base.impl import ConstraintSupport from dbt.adapters.base.meta import available from dbt.adapters.base.relation import BaseRelation from dbt.adapters.cache import _make_ref_key_dict from dbt.adapters.capability import Capability, CapabilityDict, CapabilitySupport, Support - -# from dbt.adapters.cache import _make_ref_key_msg +from dbt.adapters.events.functions import fire_event +from dbt.adapters.events.types import SchemaCreation from dbt.adapters.sql import SQLAdapter from dbt.adapters.sql.impl import CREATE_SCHEMA_MACRO_NAME -from dbt.contracts.graph.nodes import ColumnLevelConstraint, ConstraintType, ModelLevelConstraint -from dbt.events.functions import fire_event -from dbt.events.types import SchemaCreation +from dbt_common.contracts.constraints import ( + ColumnLevelConstraint, + ConstraintType, + ModelLevelConstraint, +) from dbt.adapters.fabric.fabric_column import FabricColumn from dbt.adapters.fabric.fabric_configs import FabricConfigs @@ -204,7 +203,7 @@ def render_model_constraint(cls, constraint: ModelLevelConstraint) -> Optional[s column_list = ", ".join(constraint.columns) if constraint.name is None: - raise dbt.exceptions.DbtDatabaseError( + raise dbt_common.exceptions.DbtDatabaseError( "Constraint name cannot be empty. Provide constraint name - column " + column_list + " and run the project again." diff --git a/dbt/adapters/fabric/fabric_connection_manager.py b/dbt/adapters/fabric/fabric_connection_manager.py index b84bb52..1168053 100644 --- a/dbt/adapters/fabric/fabric_connection_manager.py +++ b/dbt/adapters/fabric/fabric_connection_manager.py @@ -6,18 +6,18 @@ from typing import Any, Callable, Dict, Mapping, Optional, Tuple, Union import agate -import dbt.exceptions +import dbt_common.exceptions import pyodbc from azure.core.credentials import AccessToken from azure.identity import AzureCliCredential, DefaultAzureCredential, EnvironmentCredential +from dbt.adapters.contracts.connection import AdapterResponse, Connection, ConnectionState +from dbt.adapters.events.logging import AdapterLogger +from dbt.adapters.events.types import ConnectionUsed, SQLQuery, SQLQueryStatus from dbt.adapters.sql import SQLConnectionManager -from dbt.clients.agate_helper import empty_table -from dbt.contracts.connection import AdapterResponse, Connection, ConnectionState -from dbt.events import AdapterLogger -from dbt.events.contextvars import get_node_info -from dbt.events.functions import fire_event -from dbt.events.types import ConnectionUsed, SQLQuery, SQLQueryStatus -from dbt.utils import cast_to_str +from dbt_common.clients.agate_helper import empty_table +from dbt_common.events.contextvars import get_node_info +from dbt_common.events.functions import fire_event +from dbt_common.utils.encoding import cast_to_str from dbt.adapters.fabric import __version__ from dbt.adapters.fabric.fabric_credentials import FabricCredentials @@ -265,19 +265,19 @@ def exception_handler(self, sql): except pyodbc.Error: logger.debug("Failed to release connection!") - raise dbt.exceptions.DbtDatabaseError(str(e).strip()) from e + raise dbt_common.exceptions.DbtDatabaseError(str(e).strip()) from e except Exception as e: logger.debug(f"Error running SQL: {sql}") logger.debug("Rolling back transaction.") self.release() - if isinstance(e, dbt.exceptions.DbtRuntimeError): + if isinstance(e, dbt_common.exceptions.DbtRuntimeError): # during a sql query, an internal to dbt exception was raised. # this sounds a lot like a signal handler and probably has # useful information, so raise it without modification. raise - raise dbt.exceptions.DbtRuntimeError(e) + raise dbt_common.exceptions.DbtRuntimeError(e) @classmethod def open(cls, connection: Connection) -> Connection: diff --git a/dbt/adapters/fabric/fabric_credentials.py b/dbt/adapters/fabric/fabric_credentials.py index 860b092..dec36fa 100644 --- a/dbt/adapters/fabric/fabric_credentials.py +++ b/dbt/adapters/fabric/fabric_credentials.py @@ -1,7 +1,7 @@ from dataclasses import dataclass from typing import Optional -from dbt.contracts.connection import Credentials +from dbt.adapters.contracts.connection import Credentials @dataclass diff --git a/tests/functional/adapter/test_dbt_clone.py b/tests/functional/adapter/test_dbt_clone.py index ba3d606..29d5009 100644 --- a/tests/functional/adapter/test_dbt_clone.py +++ b/tests/functional/adapter/test_dbt_clone.py @@ -4,7 +4,6 @@ from copy import deepcopy import pytest -from dbt.exceptions import DbtRuntimeError from dbt.tests.adapter.dbt_clone.fixtures import ( custom_can_clone_tables_false_macros_sql, ephemeral_model_sql, @@ -19,6 +18,7 @@ view_model_sql, ) from dbt.tests.util import run_dbt +from dbt_common.exceptions import DbtRuntimeError class BaseClone: From 8ed624540a62477f79e0eb37c630a54f4dc30cbf Mon Sep 17 00:00:00 2001 From: nszoni Date: Mon, 19 Feb 2024 13:33:49 +0100 Subject: [PATCH 04/11] fix imports and deps --- dbt/adapters/fabric/__init__.py | 2 +- dbt/adapters/fabric/fabric_adapter.py | 2 +- dbt/adapters/fabric/fabric_connection_manager.py | 2 +- dev_requirements.txt | 7 ++++++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/dbt/adapters/fabric/__init__.py b/dbt/adapters/fabric/__init__.py index 038bd86..efd0d23 100644 --- a/dbt/adapters/fabric/__init__.py +++ b/dbt/adapters/fabric/__init__.py @@ -1,11 +1,11 @@ from dbt.adapters.base import AdapterPlugin -from dbt.adapters.include import fabric from dbt.adapters.fabric.fabric_adapter import FabricAdapter from dbt.adapters.fabric.fabric_column import FabricColumn from dbt.adapters.fabric.fabric_configs import FabricConfigs from dbt.adapters.fabric.fabric_connection_manager import FabricConnectionManager from dbt.adapters.fabric.fabric_credentials import FabricCredentials +from dbt.include import fabric Plugin = AdapterPlugin( adapter=FabricAdapter, diff --git a/dbt/adapters/fabric/fabric_adapter.py b/dbt/adapters/fabric/fabric_adapter.py index 4ffdaa9..10ca700 100644 --- a/dbt/adapters/fabric/fabric_adapter.py +++ b/dbt/adapters/fabric/fabric_adapter.py @@ -8,7 +8,6 @@ from dbt.adapters.base.relation import BaseRelation from dbt.adapters.cache import _make_ref_key_dict from dbt.adapters.capability import Capability, CapabilityDict, CapabilitySupport, Support -from dbt.adapters.events.functions import fire_event from dbt.adapters.events.types import SchemaCreation from dbt.adapters.sql import SQLAdapter from dbt.adapters.sql.impl import CREATE_SCHEMA_MACRO_NAME @@ -17,6 +16,7 @@ ConstraintType, ModelLevelConstraint, ) +from dbt_common.events.functions import fire_event from dbt.adapters.fabric.fabric_column import FabricColumn from dbt.adapters.fabric.fabric_configs import FabricConfigs diff --git a/dbt/adapters/fabric/fabric_connection_manager.py b/dbt/adapters/fabric/fabric_connection_manager.py index 1168053..351317c 100644 --- a/dbt/adapters/fabric/fabric_connection_manager.py +++ b/dbt/adapters/fabric/fabric_connection_manager.py @@ -17,7 +17,7 @@ from dbt_common.clients.agate_helper import empty_table from dbt_common.events.contextvars import get_node_info from dbt_common.events.functions import fire_event -from dbt_common.utils.encoding import cast_to_str +from dbt_common.utils.casting import cast_to_str from dbt.adapters.fabric import __version__ from dbt.adapters.fabric.fabric_credentials import FabricCredentials diff --git a/dev_requirements.txt b/dev_requirements.txt index 9e0e3dd..cdf7ab8 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -1,9 +1,14 @@ +# install latest changes in dbt-core +# TODO: how to automate switching from develop to version branches? +git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core +git+https://github.com/dbt-labs/dbt-adapters.git +git+https://github.com/dbt-labs/dbt-adapters.git#subdirectory=dbt-tests-adapter + pytest==8.0.1 twine==5.0.0 wheel==0.42 pre-commit==3.5.0 pytest-dotenv==0.5.2 -dbt-tests-adapter~=1.7.8 flaky==3.7.0 pytest-xdist==3.5.0 -e . From 3703c149a67a9a03a37fe14ed3556a6aedc566ec Mon Sep 17 00:00:00 2001 From: nszoni Date: Fri, 23 Feb 2024 16:42:31 +0100 Subject: [PATCH 05/11] change incremental rollback test logic with backup --- tests/functional/adapter/test_constraints.py | 32 +++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/tests/functional/adapter/test_constraints.py b/tests/functional/adapter/test_constraints.py index eeaef69..ed7ed9f 100644 --- a/tests/functional/adapter/test_constraints.py +++ b/tests/functional/adapter/test_constraints.py @@ -648,4 +648,34 @@ class TestTableConstraintsRollback(BaseConstraintsRollback): class TestIncrementalConstraintsRollback(BaseIncrementalConstraintsRollback): - pass + def test__constraints_enforcement_rollback( + self, project, expected_color, expected_error_messages, null_model_sql + ): + results = run_dbt(["run", "-s", "my_model"]) + assert len(results) == 1 + + # Make a contract-breaking change to the model + write_file(null_model_sql, "models", "my_model.sql") + # drops the previous table before + # when there is an exception, cant rollback + failing_results = run_dbt(["run", "-s", "my_model"], expect_pass=False) + assert len(failing_results) == 1 + + # Verify the previous table still exists, + # for incremental we are not creating backups, because its not a create replace + relation = relation_from_name(project.adapter, "my_model") + old_model_exists_sql = f"select * from {relation}" + old_model_exists = project.run_sql(old_model_exists_sql, fetch="all") + assert len(old_model_exists) == 1 + assert old_model_exists[0][1] == expected_color + + # Confirm this model was contracted + # TODO: is this step really necessary? + manifest = get_manifest(project.project_root) + model_id = "model.test.my_model" + my_model_config = manifest.nodes[model_id].config + contract_actual_config = my_model_config.contract + assert contract_actual_config.enforced is True + + # Its result includes the expected error messages + self.assert_expected_error_messages(failing_results[0].message, expected_error_messages) From fd6e185f266052d9f9d1a8c5795405a06ffdd2c6 Mon Sep 17 00:00:00 2001 From: nszoni Date: Fri, 23 Feb 2024 16:43:08 +0100 Subject: [PATCH 06/11] refactor relation queries to use sys catalog instead of information schema --- .../fabric/macros/adapters/catalog.sql | 48 ++++++++------ .../fabric/macros/adapters/metadata.sql | 62 +++++++++++-------- .../test_list_relations_without_caching.py | 26 +++++--- 3 files changed, 81 insertions(+), 55 deletions(-) diff --git a/dbt/include/fabric/macros/adapters/catalog.sql b/dbt/include/fabric/macros/adapters/catalog.sql index 6d8d5c8..cd02a29 100644 --- a/dbt/include/fabric/macros/adapters/catalog.sql +++ b/dbt/include/fabric/macros/adapters/catalog.sql @@ -22,6 +22,7 @@ tables as ( select + object_id, name as table_name, schema_id as schema_id, principal_id as principal_id, @@ -32,6 +33,7 @@ tables_with_metadata as ( select + object_id, table_name, schema_name, coalesce(tables.principal_id, schemas.principal_id) as owner_principal_id, @@ -43,6 +45,7 @@ views as ( select + object_id, name as table_name, schema_id as schema_id, principal_id as principal_id, @@ -53,6 +56,7 @@ views_with_metadata as ( select + object_id, table_name, schema_name, coalesce(views.principal_id, schemas.principal_id) as owner_principal_id, @@ -64,6 +68,7 @@ tables_and_views as ( select + object_id, table_name, schema_name, principal_name, @@ -73,6 +78,7 @@ join principals on tables_with_metadata.owner_principal_id = principals.principal_id union all select + object_id, table_name, schema_name, principal_name, @@ -85,18 +91,16 @@ cols as ( select - table_catalog as table_database, - table_schema, - table_name, - column_name, - ordinal_position as column_index, - data_type as column_type - from INFORMATION_SCHEMA.COLUMNS {{ information_schema_hints() }} - + c.object_id, + c.name as column_name, + c.column_id as column_index, + t.name as column_type + from sys.columns as c {{ information_schema_hints() }} + left join sys.types as t on c.system_type_id = t.system_type_id {{ information_schema_hints() }} ) select - cols.table_database, + DB_NAME() as table_database, tv.schema_name as table_schema, tv.table_name, tv.table_type, @@ -107,7 +111,7 @@ cols.column_type, null as column_comment from tables_and_views tv - join cols on tv.schema_name = cols.table_schema and tv.table_name = cols.table_name + join cols on tv.object_id = cols.object_id where ({%- for schema in schemas -%} upper(tv.schema_name) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%} {%- endfor -%}) @@ -144,6 +148,7 @@ tables as ( select + object_id, name as table_name, schema_id as schema_id, principal_id as principal_id, @@ -154,6 +159,7 @@ tables_with_metadata as ( select + object_id, table_name, schema_name, coalesce(tables.principal_id, schemas.principal_id) as owner_principal_id, @@ -165,6 +171,7 @@ views as ( select + object_id, name as table_name, schema_id as schema_id, principal_id as principal_id, @@ -175,6 +182,7 @@ views_with_metadata as ( select + object_id, table_name, schema_name, coalesce(views.principal_id, schemas.principal_id) as owner_principal_id, @@ -186,6 +194,7 @@ tables_and_views as ( select + object_id, table_name, schema_name, principal_name, @@ -195,6 +204,7 @@ join principals on tables_with_metadata.owner_principal_id = principals.principal_id union all select + object_id, table_name, schema_name, principal_name, @@ -207,18 +217,16 @@ cols as ( select - table_catalog as table_database, - table_schema, - table_name, - column_name, - ordinal_position as column_index, - data_type as column_type - from INFORMATION_SCHEMA.COLUMNS {{ information_schema_hints() }} - + c.object_id, + c.name as column_name, + c.column_id as column_index, + t.name as column_type + from sys.columns as c {{ information_schema_hints() }} + left join sys.types as t on c.system_type_id = t.system_type_id {{ information_schema_hints() }} ) select - cols.table_database, + DB_NAME() as table_database, tv.schema_name as table_schema, tv.table_name, tv.table_type, @@ -229,7 +237,7 @@ cols.column_type, null as column_comment from tables_and_views tv - join cols on tv.schema_name = cols.table_schema and tv.table_name = cols.table_name + join cols on tv.object_id = cols.object_id where ( {%- for relation in relations -%} {% if relation.schema and relation.identifier %} diff --git a/dbt/include/fabric/macros/adapters/metadata.sql b/dbt/include/fabric/macros/adapters/metadata.sql index e5dc3a1..fb66feb 100644 --- a/dbt/include/fabric/macros/adapters/metadata.sql +++ b/dbt/include/fabric/macros/adapters/metadata.sql @@ -28,37 +28,49 @@ {% macro fabric__list_relations_without_caching(schema_relation) -%} {% call statement('list_relations_without_caching', fetch_result=True) -%} - select - table_catalog as [database], - table_name as [name], - table_schema as [schema], - case when table_type = 'BASE TABLE' then 'table' - when table_type = 'VIEW' then 'view' - else table_type - end as table_type - - from INFORMATION_SCHEMA.TABLES {{ information_schema_hints() }} - where table_schema like '{{ schema_relation.schema }}' + with base as ( + select + DB_NAME() as [database], + t.name as [name], + SCHEMA_NAME(t.schema_id) as [schema], + 'table' as table_type + from sys.tables as t {{ information_schema_hints() }} + union all + select + DB_NAME() as [database], + v.name as [name], + SCHEMA_NAME(v.schema_id) as [schema], + 'view' as table_type + from sys.views as v {{ information_schema_hints() }} + ) + select * from base + where [schema] like '{{ schema_relation.schema }}' {% endcall %} {{ return(load_result('list_relations_without_caching').table) }} {% endmacro %} {% macro fabric__get_relation_without_caching(schema_relation) -%} - {% call statement('list_relations_without_caching', fetch_result=True) -%} - select - table_catalog as [database], - table_name as [name], - table_schema as [schema], - case when table_type = 'BASE TABLE' then 'table' - when table_type = 'VIEW' then 'view' - else table_type - end as table_type - - from INFORMATION_SCHEMA.TABLES {{ information_schema_hints() }} - where table_schema like '{{ schema_relation.schema }}' - and table_name like '{{ schema_relation.identifier }}' + {% call statement('get_relation_without_caching', fetch_result=True) -%} + with base as ( + select + DB_NAME() as [database], + t.name as [name], + SCHEMA_NAME(t.schema_id) as [schema], + 'table' as table_type + from sys.tables as t {{ information_schema_hints() }} + union all + select + DB_NAME() as [database], + v.name as [name], + SCHEMA_NAME(v.schema_id) as [schema], + 'view' as table_type + from sys.views as v {{ information_schema_hints() }} + ) + select * from base + where [schema] like '{{ schema_relation.schema }}' + and [name] like '{{ schema_relation.identifier }}' {% endcall %} - {{ return(load_result('list_relations_without_caching').table) }} + {{ return(load_result('get_relation_without_caching').table) }} {% endmacro %} {% macro fabric__get_relation_last_modified(information_schema, relations) -%} diff --git a/tests/functional/adapter/test_list_relations_without_caching.py b/tests/functional/adapter/test_list_relations_without_caching.py index 0fd6260..3c43761 100644 --- a/tests/functional/adapter/test_list_relations_without_caching.py +++ b/tests/functional/adapter/test_list_relations_without_caching.py @@ -21,17 +21,23 @@ {% macro validate_list_relations_without_caching(schema_relation) -%} {% call statement('list_relations_without_caching', fetch_result=True) -%} + with base as ( select - table_catalog as [database], - table_name as [name], - table_schema as [schema], - case when table_type = 'BASE TABLE' then 'table' - when table_type = 'VIEW' then 'view' - else table_type - end as table_type - - from INFORMATION_SCHEMA.TABLES - where table_schema like '{{ schema_relation }}' + DB_NAME() as [database], + t.name as [name], + SCHEMA_NAME(t.schema_id) as [schema], + 'table' as table_type + from sys.tables as t {{ information_schema_hints() }} + union all + select + DB_NAME() as [database], + v.name as [name], + SCHEMA_NAME(v.schema_id) as [schema], + 'view' as table_type + from sys.views as v {{ information_schema_hints() }} + ) + select * from base + where [schema] like '{{ schema_relation }}' {% endcall %} {% set relation_list_result = load_result('list_relations_without_caching').table %} From c9d5d2f1d46b52338b0d9479c93305abe1664cd7 Mon Sep 17 00:00:00 2001 From: nszoni Date: Fri, 23 Feb 2024 16:43:20 +0100 Subject: [PATCH 07/11] bump precommit --- dev_requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev_requirements.txt b/dev_requirements.txt index cdf7ab8..8e84b88 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -7,7 +7,7 @@ git+https://github.com/dbt-labs/dbt-adapters.git#subdirectory=dbt-tests-adapter pytest==8.0.1 twine==5.0.0 wheel==0.42 -pre-commit==3.5.0 +pre-commit==3.6.2 pytest-dotenv==0.5.2 flaky==3.7.0 pytest-xdist==3.5.0 From 60da1d6e8eccc7b9ece886b0a438b0dbc4a7b3b0 Mon Sep 17 00:00:00 2001 From: nszoni Date: Fri, 23 Feb 2024 16:43:29 +0100 Subject: [PATCH 08/11] update changelog --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 811eec0..8bd6b1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +### v1.8.0rc1 + +[Decouple imports](https://github.com/dbt-labs/dbt-adapters/discussions/87) to common dbt core and dbt adapter interface packages for future maintainability and extensibility. + +* Bump adapter packages + - from pyodbc>=4.0.35,<5.1.0" to pyodbc>=4.0.35,<5.2.0 + +> From now on, Apple-silicon users don't have to locally build pyodbc, because M1, M2 binaries is included in pyodbc from 5.1.0 onwards! + +## Enhancements +* Refactor relations to query from sys catalog instead of information schema causing concurrency issues when running multiple threads in parallel (https://github.com/microsoft/dbt-fabric/issues/52). +* Bump dev requirements + - from pytest~=7.4. to pytest~=8.0.1 + - from twine~=4.0.2 to twine~=5.0.0 + - from pre-commit~=3.5.0 to pre-commit~=3.6.2 + ### v1.7.3 ## Enhancements From 0fddcc0a43795b0fd91a151d2fad816662f2a19d Mon Sep 17 00:00:00 2001 From: nszoni Date: Fri, 23 Feb 2024 16:48:21 +0100 Subject: [PATCH 09/11] better changelog --- CHANGELOG.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bd6b1e..1658e6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ ### v1.8.0rc1 +## Features + +Supporting dbt-core 1.8.0 + +## Bug fixes + +* Refactor relations to query from sys catalog instead of information schema causing concurrency issues when running multiple threads in parallel (https://github.com/microsoft/dbt-fabric/issues/52). + +## Enhancements + [Decouple imports](https://github.com/dbt-labs/dbt-adapters/discussions/87) to common dbt core and dbt adapter interface packages for future maintainability and extensibility. * Bump adapter packages @@ -9,8 +19,7 @@ > From now on, Apple-silicon users don't have to locally build pyodbc, because M1, M2 binaries is included in pyodbc from 5.1.0 onwards! -## Enhancements -* Refactor relations to query from sys catalog instead of information schema causing concurrency issues when running multiple threads in parallel (https://github.com/microsoft/dbt-fabric/issues/52). + * Bump dev requirements - from pytest~=7.4. to pytest~=8.0.1 - from twine~=4.0.2 to twine~=5.0.0 From f07f2fcf80fe512b9e921c8cf5fb8906e3ee09d3 Mon Sep 17 00:00:00 2001 From: nszoni Date: Fri, 23 Feb 2024 16:54:56 +0100 Subject: [PATCH 10/11] split precommit deps --- dev_requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dev_requirements.txt b/dev_requirements.txt index 8e84b88..be69fe1 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -7,7 +7,8 @@ git+https://github.com/dbt-labs/dbt-adapters.git#subdirectory=dbt-tests-adapter pytest==8.0.1 twine==5.0.0 wheel==0.42 -pre-commit==3.6.2 +pre-commit==3.5.0;python_version<"3.9" +pre-commit==3.6.2;python_version>="3.9" pytest-dotenv==0.5.2 flaky==3.7.0 pytest-xdist==3.5.0 From ce1f174dbf2ae772b32047703fe87752d4224058 Mon Sep 17 00:00:00 2001 From: nszoni Date: Mon, 26 Feb 2024 10:05:09 +0100 Subject: [PATCH 11/11] fix versinioning --- dbt/adapters/fabric/__version__.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dbt/adapters/fabric/__version__.py b/dbt/adapters/fabric/__version__.py index 037ac1f..f15b401 100644 --- a/dbt/adapters/fabric/__version__.py +++ b/dbt/adapters/fabric/__version__.py @@ -1 +1 @@ -version = "1.8.0rc1" +version = "1.8.0a1" diff --git a/setup.py b/setup.py index de4c648..8f98ea4 100644 --- a/setup.py +++ b/setup.py @@ -68,7 +68,7 @@ def run(self): install_requires=[ "pyodbc>=4.0.35,<5.2.0", "azure-identity>=1.12.0", - "dbt-common~=0.1.5", + "dbt-common~=0.1.6", "dbt-adapters~=0.1.0a6", ], cmdclass={