From 5b4b2f7cb186b2c8cddee85cf4ea7f54dee79505 Mon Sep 17 00:00:00 2001 From: Colin Date: Wed, 16 Oct 2024 11:34:04 -0700 Subject: [PATCH 1/6] Add SnowflakeExternalCatalogIntegration to impl --- dbt/adapters/snowflake/impl.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dbt/adapters/snowflake/impl.py b/dbt/adapters/snowflake/impl.py index 6320893e1..fe7ea676e 100644 --- a/dbt/adapters/snowflake/impl.py +++ b/dbt/adapters/snowflake/impl.py @@ -4,6 +4,7 @@ from dbt.adapters.base.impl import AdapterConfig, ConstraintSupport from dbt.adapters.base.meta import available from dbt.adapters.capability import CapabilityDict, CapabilitySupport, Support, Capability +from dbt.adapters.snowflake.catalog import SnowflakeExternalCatalogIntegration from dbt.adapters.sql import SQLAdapter from dbt.adapters.sql.impl import ( LIST_SCHEMAS_MACRO_NAME, @@ -58,6 +59,7 @@ class SnowflakeAdapter(SQLAdapter): Relation = SnowflakeRelation Column = SnowflakeColumn ConnectionManager = SnowflakeConnectionManager + ExternalCatalogIntegration = SnowflakeExternalCatalogIntegration AdapterSpecificConfigs = SnowflakeConfig From cb898d2dda087a08ebdb72c69e58134f0f8670ba Mon Sep 17 00:00:00 2001 From: Colin Date: Wed, 16 Oct 2024 11:36:06 -0700 Subject: [PATCH 2/6] Add SnowflakeExternalCatalogIntegration to impl --- dbt/adapters/snowflake/catalog.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 dbt/adapters/snowflake/catalog.py diff --git a/dbt/adapters/snowflake/catalog.py b/dbt/adapters/snowflake/catalog.py new file mode 100644 index 000000000..0a05d88c5 --- /dev/null +++ b/dbt/adapters/snowflake/catalog.py @@ -0,0 +1,29 @@ +from dbt.adapters.base import BaseRelation +from dbt.adapters.base.catalog import ExternalCatalogIntegration + + +class SnowflakeExternalCatalogIntegration(ExternalCatalogIntegration): + + def relation_exists(self, relation: BaseRelation) -> bool: + response, result = self._connection_manager.execute(f"DESCRIBE ICEBERG TABLE {relation.render()}") + if result and result.rows: + return True + return False + + def _exists(self) -> bool: + if not self._exists: + response, result = self._connection_manager.execute( + f"DESCRIBE CATALOG INTEGRATION {self.external_catalog.name}") + if result and result.rows: + self._exists = True + else: + self._exists = False + return self._exists + + def refresh_relation(self, relation: BaseRelation) -> None: + self._connection_manager.execute(f"ALTER ICEBERG TABLE {relation.render()} REFRESH") + + def create_relation(self, relation: BaseRelation) -> None: + self._connection_manager.execute(f"CREATE ICEBERG TABLE {relation.render()}" + f"EXTERNAL_VOLUME '{self.external_catalog.configuration.external_volume.name}'" + f"CATALOG='{self.external_catalog.name}'") From e30577886131ec1da3ffdec35873671c5037c68a Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 6 Jan 2025 12:13:33 -0800 Subject: [PATCH 3/6] add concrete catalog integration config --- dbt/adapters/snowflake/catalog.py | 84 ++++++++++++------- dbt/adapters/snowflake/impl.py | 9 ++ .../relation_configs/dynamic_table.py | 38 +++++++-- .../macros/relations/dynamic_table/create.sql | 1 + dev-requirements.txt | 2 +- 5 files changed, 100 insertions(+), 34 deletions(-) diff --git a/dbt/adapters/snowflake/catalog.py b/dbt/adapters/snowflake/catalog.py index 0a05d88c5..b342d5bf0 100644 --- a/dbt/adapters/snowflake/catalog.py +++ b/dbt/adapters/snowflake/catalog.py @@ -1,29 +1,57 @@ +from typing import Dict, Optional + +import textwrap + from dbt.adapters.base import BaseRelation -from dbt.adapters.base.catalog import ExternalCatalogIntegration - - -class SnowflakeExternalCatalogIntegration(ExternalCatalogIntegration): - - def relation_exists(self, relation: BaseRelation) -> bool: - response, result = self._connection_manager.execute(f"DESCRIBE ICEBERG TABLE {relation.render()}") - if result and result.rows: - return True - return False - - def _exists(self) -> bool: - if not self._exists: - response, result = self._connection_manager.execute( - f"DESCRIBE CATALOG INTEGRATION {self.external_catalog.name}") - if result and result.rows: - self._exists = True - else: - self._exists = False - return self._exists - - def refresh_relation(self, relation: BaseRelation) -> None: - self._connection_manager.execute(f"ALTER ICEBERG TABLE {relation.render()} REFRESH") - - def create_relation(self, relation: BaseRelation) -> None: - self._connection_manager.execute(f"CREATE ICEBERG TABLE {relation.render()}" - f"EXTERNAL_VOLUME '{self.external_catalog.configuration.external_volume.name}'" - f"CATALOG='{self.external_catalog.name}'") +from dbt.adapters.contracts.catalog import CatalogIntegration, CatalogIntegrationType +from dbt.adapters.contracts.relation import RelationConfig + + +class SnowflakeManagedIcebergCatalogIntegration(CatalogIntegration): + catalog_type = CatalogIntegrationType.managed + + def render_ddl_predicates(self, relation: RelationConfig) -> str: + """ + {{ optional('external_volume', dynamic_table.catalog.external_volume) }} + {{ optional('catalog', dynamic_table.catalog.name) }} + base_location = '{{ dynamic_table.catalog.base_location }}' + :param relation: + :return: + """ + base_location: str = f"_dbt/{relation.schema}/{relation.name}" + + if sub_path := relation.config.get("base_location_subpath"): + base_location += f"/{sub_path}" + + iceberg_ddl_predicates: str = f""" + external_volume = '{self.external_volume}' + catalog = 'snowflake' + base_location = '{base_location}' + """ + return textwrap.indent(textwrap.dedent(iceberg_ddl_predicates), " " * 10) + + +class SnowflakeGlueCatalogIntegration(CatalogIntegration): + catalog_type = CatalogIntegrationType.glue + auto_refresh: str = "FALSE" + replace_invalid_characters: str = "FALSE" + + def _handle_adapter_configs(self, adapter_configs: Optional[Dict]) -> None: + if adapter_configs: + if "auto_refresh" in adapter_configs: + self.auto_refresh = adapter_configs["auto_refresh"] + if "replace_invalid_characters" in adapter_configs: + self.replace_invalid_characters = adapter_configs["replace_invalid_characters"] + + def render_ddl_predicates(self, relation: BaseRelation) -> str: + ddl_predicate = f"""create or replace iceberg table {relation.render()} + external_volume = '{self.external_volume} + catalog = '{self.name}' + """ + if self.namespace: + ddl_predicate += "CATALOG_NAMESPACE = '{self.namespace}'" + if self.auto_refresh: + ddl_predicate += f"REPLACE_INVALID_CHARACTERS = {self.auto_refresh}" + if self.replace_invalid_characters: + ddl_predicate += f"AUTO_REFRESH = {self.replace_invalid_characters}" + return ddl_predicate diff --git a/dbt/adapters/snowflake/impl.py b/dbt/adapters/snowflake/impl.py index 10ad2a8a1..10f090c7d 100644 --- a/dbt/adapters/snowflake/impl.py +++ b/dbt/adapters/snowflake/impl.py @@ -4,7 +4,12 @@ from dbt.adapters.base.impl import AdapterConfig, ConstraintSupport from dbt.adapters.base.meta import available from dbt.adapters.capability import CapabilityDict, CapabilitySupport, Support, Capability +from dbt.adapters.contracts.catalog import CatalogIntegrationType from dbt.adapters.contracts.relation import RelationConfig +from dbt.adapters.snowflake.catalog import ( + SnowflakeManagedIcebergCatalogIntegration, + SnowflakeGlueCatalogIntegration, +) from dbt.adapters.sql import SQLAdapter from dbt.adapters.sql.impl import ( LIST_SCHEMAS_MACRO_NAME, @@ -62,6 +67,10 @@ class SnowflakeAdapter(SQLAdapter): ConnectionManager = SnowflakeConnectionManager AdapterSpecificConfigs = SnowflakeConfig + CatalogIntegrations = { + CatalogIntegrationType.iceberg_managed: SnowflakeManagedIcebergCatalogIntegration, + CatalogIntegrationType.glue: SnowflakeGlueCatalogIntegration, + } CONSTRAINT_SUPPORT = { ConstraintType.check: ConstraintSupport.NOT_SUPPORTED, diff --git a/dbt/adapters/snowflake/relation_configs/dynamic_table.py b/dbt/adapters/snowflake/relation_configs/dynamic_table.py index 7361df80a..e22ba79aa 100644 --- a/dbt/adapters/snowflake/relation_configs/dynamic_table.py +++ b/dbt/adapters/snowflake/relation_configs/dynamic_table.py @@ -1,19 +1,22 @@ from dataclasses import dataclass -from typing import Optional, Dict, Any, TYPE_CHECKING +from typing import Optional, Dict, Any, TYPE_CHECKING, Union +from dbt.adapters.contracts.catalog import CatalogIntegrationConfig, CatalogIntegrationType from dbt.adapters.relation_configs import RelationConfigChange, RelationResults +from dbt.adapters.clients import catalogs as catalogs_client from dbt.adapters.contracts.relation import RelationConfig from dbt.adapters.contracts.relation import ComponentName from dbt_common.dataclass_schema import StrEnum # doesn't exist in standard library until py3.11 from typing_extensions import Self +from dbt.adapters.relation_configs.formats import TableFormat +from dbt.adapters.snowflake.catalog import SnowflakeManagedIcebergCatalogIntegration from dbt.adapters.snowflake.relation_configs.base import SnowflakeRelationConfigBase from dbt.adapters.snowflake.relation_configs.catalog import ( SnowflakeCatalogConfig, SnowflakeCatalogConfigChange, ) - if TYPE_CHECKING: import agate @@ -37,6 +40,29 @@ def default(cls) -> Self: return cls("ON_CREATE") +def _setup_catalog_integration(catalog_info: Union[Dict, RelationConfig]) -> Optional[str]: + if isinstance(catalog_info, Dict): + catalog_config = SnowflakeCatalogConfig.from_dict(catalog_info) + else: + catalog_config = SnowflakeCatalogConfig.parse_relation_config(catalog_info) # type: ignore + if catalog_config.table_format != TableFormat.default(): + catalog_name = "snowflake_managed" + integration_config = CatalogIntegrationConfig( + catalog_name=catalog_name, + integration_name=catalog_config.name, + table_format=catalog_config.table_format, + catalog_type=CatalogIntegrationType.managed, + external_volume=catalog_config.external_volume, + ) + catalogs_client.add_catalog( + SnowflakeManagedIcebergCatalogIntegration(integration_config), + catalog_name=catalog_name, + ) + return catalog_name + else: + return None + + @dataclass(frozen=True, eq=True, unsafe_hash=True) class SnowflakeDynamicTableConfig(SnowflakeRelationConfigBase): """ @@ -60,12 +86,13 @@ class SnowflakeDynamicTableConfig(SnowflakeRelationConfigBase): query: str target_lag: str snowflake_warehouse: str - catalog: SnowflakeCatalogConfig + catalog: Optional[str] refresh_mode: Optional[RefreshMode] = RefreshMode.default() initialize: Optional[Initialize] = Initialize.default() @classmethod def from_dict(cls, config_dict: Dict[str, Any]) -> Self: + catalog = _setup_catalog_integration(config_dict["catalog"]) kwargs_dict = { "name": cls._render_part(ComponentName.Identifier, config_dict.get("name")), "schema_name": cls._render_part(ComponentName.Schema, config_dict.get("schema_name")), @@ -75,7 +102,7 @@ def from_dict(cls, config_dict: Dict[str, Any]) -> Self: "query": config_dict.get("query"), "target_lag": config_dict.get("target_lag"), "snowflake_warehouse": config_dict.get("snowflake_warehouse"), - "catalog": SnowflakeCatalogConfig.from_dict(config_dict["catalog"]), + "catalog": catalog, "refresh_mode": config_dict.get("refresh_mode"), "initialize": config_dict.get("initialize"), } @@ -84,6 +111,7 @@ def from_dict(cls, config_dict: Dict[str, Any]) -> Self: @classmethod def parse_relation_config(cls, relation_config: RelationConfig) -> Dict[str, Any]: + catalog = _setup_catalog_integration(relation_config) config_dict = { "name": relation_config.identifier, "schema_name": relation_config.schema, @@ -91,7 +119,7 @@ def parse_relation_config(cls, relation_config: RelationConfig) -> Dict[str, Any "query": relation_config.compiled_code, "target_lag": relation_config.config.extra.get("target_lag"), "snowflake_warehouse": relation_config.config.extra.get("snowflake_warehouse"), - "catalog": SnowflakeCatalogConfig.parse_relation_config(relation_config), + "catalog": catalog, } if refresh_mode := relation_config.config.extra.get("refresh_mode"): diff --git a/dbt/include/snowflake/macros/relations/dynamic_table/create.sql b/dbt/include/snowflake/macros/relations/dynamic_table/create.sql index 4ebcf145b..c59449cf4 100644 --- a/dbt/include/snowflake/macros/relations/dynamic_table/create.sql +++ b/dbt/include/snowflake/macros/relations/dynamic_table/create.sql @@ -69,6 +69,7 @@ -- Returns: -- A valid DDL statement which will result in a new dynamic iceberg table. -#} + {%- set catalog_integration = adapter.get_catalog_integration(model.catalog) -%} create dynamic iceberg table {{ relation }} target_lag = '{{ dynamic_table.target_lag }}' diff --git a/dev-requirements.txt b/dev-requirements.txt index 906003768..6580efdba 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,5 +1,5 @@ # install latest changes in dbt-core -git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core +git+https://github.com/dbt-labs/dbt-core.git@catalogs-parsing#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 git+https://github.com/dbt-labs/dbt-common.git From 4fd599e6d29c2dcfe86e0b8a26d7d1d6f0df6ea6 Mon Sep 17 00:00:00 2001 From: Colin Date: Tue, 7 Jan 2025 12:51:38 -0800 Subject: [PATCH 4/6] merge main --- dbt/adapters/snowflake/impl.py | 2 +- dbt/adapters/snowflake/relation_configs/catalog.py | 4 ++++ .../snowflake/relation_configs/dynamic_table.py | 12 ++++++++---- .../macros/relations/dynamic_table/create.sql | 13 ++++++++----- .../macros/relations/dynamic_table/replace.sql | 11 +++++++---- .../relation_tests/test_relation_type_change.py | 2 +- 6 files changed, 29 insertions(+), 15 deletions(-) diff --git a/dbt/adapters/snowflake/impl.py b/dbt/adapters/snowflake/impl.py index a3053d0b8..b4e058cd9 100644 --- a/dbt/adapters/snowflake/impl.py +++ b/dbt/adapters/snowflake/impl.py @@ -69,7 +69,7 @@ class SnowflakeAdapter(SQLAdapter): AdapterSpecificConfigs = SnowflakeConfig CatalogIntegrations = { - CatalogIntegrationType.iceberg_managed: SnowflakeManagedIcebergCatalogIntegration, + CatalogIntegrationType.managed: SnowflakeManagedIcebergCatalogIntegration, CatalogIntegrationType.glue: SnowflakeGlueCatalogIntegration, } diff --git a/dbt/adapters/snowflake/relation_configs/catalog.py b/dbt/adapters/snowflake/relation_configs/catalog.py index c8d7de40f..309dac579 100644 --- a/dbt/adapters/snowflake/relation_configs/catalog.py +++ b/dbt/adapters/snowflake/relation_configs/catalog.py @@ -89,6 +89,10 @@ def parse_relation_config(cls, relation_config: RelationConfig) -> Dict[str, Any return config_dict + @classmethod + def from_relation_config(cls, relation_config: RelationConfig) -> Self: + return cls.from_dict(cls.parse_relation_config(relation_config)) + @classmethod def parse_relation_results(cls, relation_results: RelationResults) -> Dict[str, Any]: # this try block can be removed once enable_iceberg_materializations is retired diff --git a/dbt/adapters/snowflake/relation_configs/dynamic_table.py b/dbt/adapters/snowflake/relation_configs/dynamic_table.py index e22ba79aa..a54e20ef7 100644 --- a/dbt/adapters/snowflake/relation_configs/dynamic_table.py +++ b/dbt/adapters/snowflake/relation_configs/dynamic_table.py @@ -41,17 +41,21 @@ def default(cls) -> Self: def _setup_catalog_integration(catalog_info: Union[Dict, RelationConfig]) -> Optional[str]: - if isinstance(catalog_info, Dict): + breakpoint() + if not catalog_info: + return None + elif isinstance(catalog_info, dict): catalog_config = SnowflakeCatalogConfig.from_dict(catalog_info) else: - catalog_config = SnowflakeCatalogConfig.parse_relation_config(catalog_info) # type: ignore + catalog_config = SnowflakeCatalogConfig.from_relation_config(catalog_info) + if catalog_config.table_format != TableFormat.default(): catalog_name = "snowflake_managed" integration_config = CatalogIntegrationConfig( catalog_name=catalog_name, integration_name=catalog_config.name, table_format=catalog_config.table_format, - catalog_type=CatalogIntegrationType.managed, + catalog_type=CatalogIntegrationType.managed.value, external_volume=catalog_config.external_volume, ) catalogs_client.add_catalog( @@ -86,7 +90,7 @@ class SnowflakeDynamicTableConfig(SnowflakeRelationConfigBase): query: str target_lag: str snowflake_warehouse: str - catalog: Optional[str] + catalog: Optional[str] = None refresh_mode: Optional[RefreshMode] = RefreshMode.default() initialize: Optional[Initialize] = Initialize.default() diff --git a/dbt/include/snowflake/macros/relations/dynamic_table/create.sql b/dbt/include/snowflake/macros/relations/dynamic_table/create.sql index c59449cf4..f09257668 100644 --- a/dbt/include/snowflake/macros/relations/dynamic_table/create.sql +++ b/dbt/include/snowflake/macros/relations/dynamic_table/create.sql @@ -15,7 +15,7 @@ {%- set dynamic_table = relation.from_config(config.model) -%} - {%- if dynamic_table.catalog.table_format == 'iceberg' -%} + {%- if dynamic_table.catalog -%} {{ _get_create_dynamic_iceberg_table_as_sql(dynamic_table, relation, sql) }} {%- else -%} {{ _get_create_dynamic_standard_table_as_sql(dynamic_table, relation, sql) }} @@ -69,14 +69,17 @@ -- Returns: -- A valid DDL statement which will result in a new dynamic iceberg table. -#} - {%- set catalog_integration = adapter.get_catalog_integration(model.catalog) -%} + + {% set catalog_integration = adapter.get_catalog_integration(dynamic_table.catalog) -%} + + {% if not catalog_integration -%} + {{ raise('Catalog integration is required for iceberg tables') }} + {%- endif -%} create dynamic iceberg table {{ relation }} target_lag = '{{ dynamic_table.target_lag }}' warehouse = {{ dynamic_table.snowflake_warehouse }} - {{ optional('external_volume', dynamic_table.catalog.external_volume) }} - {{ optional('catalog', dynamic_table.catalog.name) }} - base_location = '{{ dynamic_table.catalog.base_location }}' + {{ catalog_integration.render_ddl_predicates(relation) }} {{ optional('refresh_mode', dynamic_table.refresh_mode) }} {{ optional('initialize', dynamic_table.initialize) }} as ( diff --git a/dbt/include/snowflake/macros/relations/dynamic_table/replace.sql b/dbt/include/snowflake/macros/relations/dynamic_table/replace.sql index 2e7b4566a..39b189948 100644 --- a/dbt/include/snowflake/macros/relations/dynamic_table/replace.sql +++ b/dbt/include/snowflake/macros/relations/dynamic_table/replace.sql @@ -15,7 +15,7 @@ {%- set dynamic_table = relation.from_config(config.model) -%} - {%- if dynamic_table.catalog.table_format == 'iceberg' -%} + {%- if dynamic_table.catalog -%} {{ _get_replace_dynamic_iceberg_table_as_sql(dynamic_table, relation, sql) }} {%- else -%} {{ _get_replace_dynamic_standard_table_as_sql(dynamic_table, relation, sql) }} @@ -68,13 +68,16 @@ -- Returns: -- A valid DDL statement which will result in a new dynamic iceberg table. -#} + {% set catalog_integration = adapter.get_catalog_integration(dynamic_table.catalog) -%} + + {% if not catalog_integration -%} + {{ raise('Catalog integration is required for iceberg tables') }} + {%- endif -%} create or replace dynamic iceberg table {{ relation }} target_lag = '{{ dynamic_table.target_lag }}' warehouse = {{ dynamic_table.snowflake_warehouse }} - {{ optional('external_volume', dynamic_table.catalog.external_volume) }} - {{ optional('catalog', dynamic_table.catalog.name) }} - base_location = '{{ dynamic_table.catalog.base_location }}' + {{ catalog_integration.render_ddl_predicates(relation) }} {{ optional('refresh_mode', dynamic_table.refresh_mode) }} {{ optional('initialize', dynamic_table.initialize) }} as ( diff --git a/tests/functional/relation_tests/test_relation_type_change.py b/tests/functional/relation_tests/test_relation_type_change.py index 1024a92ca..244c5cb81 100644 --- a/tests/functional/relation_tests/test_relation_type_change.py +++ b/tests/functional/relation_tests/test_relation_type_change.py @@ -120,7 +120,7 @@ def test_replace(self, project, scenario): assert relation_type == scenario.final.relation_type, scenario.error_message if relation_type == "dynamic_table": dynamic_table = describe_dynamic_table(project, scenario.name) - assert dynamic_table.catalog.table_format == scenario.final.table_format + assert dynamic_table.catalog is not None else: pytest.skip() From 6b601360643885cd05f6fa1ca72f1374d1668223 Mon Sep 17 00:00:00 2001 From: Colin Date: Tue, 7 Jan 2025 12:59:04 -0800 Subject: [PATCH 5/6] update dependent branches in hatch.toml --- .../snowflake/macros/relations/dynamic_table/create.sql | 2 +- .../snowflake/macros/relations/dynamic_table/replace.sql | 2 +- hatch.toml | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dbt/include/snowflake/macros/relations/dynamic_table/create.sql b/dbt/include/snowflake/macros/relations/dynamic_table/create.sql index f09257668..ac77bf556 100644 --- a/dbt/include/snowflake/macros/relations/dynamic_table/create.sql +++ b/dbt/include/snowflake/macros/relations/dynamic_table/create.sql @@ -15,7 +15,7 @@ {%- set dynamic_table = relation.from_config(config.model) -%} - {%- if dynamic_table.catalog -%} + {%- if dynamic_table.catalog is not none -%} {{ _get_create_dynamic_iceberg_table_as_sql(dynamic_table, relation, sql) }} {%- else -%} {{ _get_create_dynamic_standard_table_as_sql(dynamic_table, relation, sql) }} diff --git a/dbt/include/snowflake/macros/relations/dynamic_table/replace.sql b/dbt/include/snowflake/macros/relations/dynamic_table/replace.sql index 39b189948..4c9b966e7 100644 --- a/dbt/include/snowflake/macros/relations/dynamic_table/replace.sql +++ b/dbt/include/snowflake/macros/relations/dynamic_table/replace.sql @@ -15,7 +15,7 @@ {%- set dynamic_table = relation.from_config(config.model) -%} - {%- if dynamic_table.catalog -%} + {%- if dynamic_table.catalog is not none -%} {{ _get_replace_dynamic_iceberg_table_as_sql(dynamic_table, relation, sql) }} {%- else -%} {{ _get_replace_dynamic_standard_table_as_sql(dynamic_table, relation, sql) }} diff --git a/hatch.toml b/hatch.toml index 2377e5d6c..db50e0618 100644 --- a/hatch.toml +++ b/hatch.toml @@ -11,10 +11,10 @@ sources = ["src"] [envs.default] dependencies = [ - "dbt-adapters @ git+https://github.com/dbt-labs/dbt-adapters.git", + "dbt-adapters @ git+https://github.com/dbt-labs/dbt-adapters.git@feature/externalCatalogConfig", "dbt-common @ git+https://github.com/dbt-labs/dbt-common.git", - "dbt-tests-adapter @ git+https://github.com/dbt-labs/dbt-adapters.git#subdirectory=dbt-tests-adapter", - "dbt-core @ git+https://github.com/dbt-labs/dbt-core.git#subdirectory=core", + "dbt-tests-adapter @ git+https://github.com/dbt-labs/dbt-adapters.git#subdirectory=dbt-tests-adapter@feature/externalCatalogConfig", + "dbt-core @ git+https://github.com/dbt-labs/dbt-core.git#subdirectory=core@catalogs-parsing", "ddtrace==2.3.0", "ipdb~=0.13.13", "pre-commit~=3.7.0", @@ -30,7 +30,7 @@ dependencies = [ setup = "pre-commit install" code-quality = "pre-commit run --all-files" unit-tests = "python -m pytest {args:tests/unit}" -integration-tests = "- python -m pytest {args:tests/functional}" +integration-tests = "python -m pytest {args:tests/functional}" docker-dev = [ "docker build -f docker/dev.Dockerfile -t dbt-snowflake-dev .", "docker run --rm -it --name dbt-snowflake-dev -v $(pwd):/opt/code dbt-snowflake-dev", From cb85618aa31a4c4dd35551d245db7a6afa00f241 Mon Sep 17 00:00:00 2001 From: Colin Date: Tue, 7 Jan 2025 13:00:51 -0800 Subject: [PATCH 6/6] update dependent branches in hatch.toml --- hatch.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hatch.toml b/hatch.toml index db50e0618..b22b571f0 100644 --- a/hatch.toml +++ b/hatch.toml @@ -13,8 +13,8 @@ sources = ["src"] dependencies = [ "dbt-adapters @ git+https://github.com/dbt-labs/dbt-adapters.git@feature/externalCatalogConfig", "dbt-common @ git+https://github.com/dbt-labs/dbt-common.git", - "dbt-tests-adapter @ git+https://github.com/dbt-labs/dbt-adapters.git#subdirectory=dbt-tests-adapter@feature/externalCatalogConfig", - "dbt-core @ git+https://github.com/dbt-labs/dbt-core.git#subdirectory=core@catalogs-parsing", + "dbt-tests-adapter @ git+https://github.com/dbt-labs/dbt-adapters.git@feature/externalCatalogConfig#subdirectory=dbt-tests-adapter", + "dbt-core @ git+https://github.com/dbt-labs/dbt-core.git@catalogs-parsing#subdirectory=core", "ddtrace==2.3.0", "ipdb~=0.13.13", "pre-commit~=3.7.0",