From b9535960e8904de5c007dda8e5d9ce8c88bbdd69 Mon Sep 17 00:00:00 2001 From: Michelle Ark Date: Thu, 26 Oct 2023 18:48:24 -0400 Subject: [PATCH 1/6] first pass --- core/dbt/adapters/factory.py | 4 ++-- core/dbt/{ => adapters}/include/global_project/__init__.py | 0 .../dbt/{ => adapters}/include/global_project/dbt_project.yml | 0 .../{ => adapters}/include/global_project/docs/overview.md | 0 .../include/global_project/macros/adapters/apply_grants.sql | 0 .../include/global_project/macros/adapters/columns.sql | 0 .../include/global_project/macros/adapters/freshness.sql | 0 .../include/global_project/macros/adapters/indexes.sql | 0 .../include/global_project/macros/adapters/metadata.sql | 0 .../include/global_project/macros/adapters/persist_docs.sql | 0 .../include/global_project/macros/adapters/relation.sql | 0 .../include/global_project/macros/adapters/schema.sql | 0 .../include/global_project/macros/adapters/show.sql | 0 .../include/global_project/macros/adapters/timestamps.sql | 0 .../include/global_project/macros/adapters/validate_sql.sql | 0 .../include/global_project/macros/etc/datetime.sql | 0 .../include/global_project/macros/etc/statement.sql | 0 .../macros/generic_test_sql/accepted_values.sql | 0 .../global_project/macros/generic_test_sql/not_null.sql | 0 .../global_project/macros/generic_test_sql/relationships.sql | 0 .../include/global_project/macros/generic_test_sql/unique.sql | 0 .../macros/get_custom_name/get_custom_alias.sql | 0 .../macros/get_custom_name/get_custom_database.sql | 0 .../macros/get_custom_name/get_custom_schema.sql | 0 .../global_project/macros/materializations/configs.sql | 0 .../include/global_project/macros/materializations/hooks.sql | 0 .../macros/materializations/models/clone/can_clone_table.sql | 0 .../macros/materializations/models/clone/clone.sql | 0 .../materializations/models/clone/create_or_replace_clone.sql | 0 .../materializations/models/incremental/column_helpers.sql | 0 .../materializations/models/incremental/incremental.sql | 0 .../materializations/models/incremental/is_incremental.sql | 0 .../macros/materializations/models/incremental/merge.sql | 0 .../materializations/models/incremental/on_schema_change.sql | 0 .../macros/materializations/models/incremental/strategies.sql | 0 .../macros/materializations/models/materialized_view.sql | 0 .../global_project/macros/materializations/models/table.sql | 0 .../global_project/macros/materializations/models/view.sql | 0 .../global_project/macros/materializations/seeds/helpers.sql | 0 .../global_project/macros/materializations/seeds/seed.sql | 0 .../macros/materializations/snapshots/helpers.sql | 0 .../macros/materializations/snapshots/snapshot.sql | 0 .../macros/materializations/snapshots/snapshot_merge.sql | 0 .../macros/materializations/snapshots/strategies.sql | 0 .../global_project/macros/materializations/tests/helpers.sql | 0 .../global_project/macros/materializations/tests/test.sql | 0 .../macros/materializations/tests/where_subquery.sql | 0 .../include/global_project/macros/python_model/python.sql | 0 .../macros/relations/column/columns_spec_ddl.sql | 0 .../include/global_project/macros/relations/create.sql | 0 .../include/global_project/macros/relations/create_backup.sql | 0 .../global_project/macros/relations/create_intermediate.sql | 0 .../include/global_project/macros/relations/drop.sql | 0 .../include/global_project/macros/relations/drop_backup.sql | 0 .../macros/relations/materialized_view/alter.sql | 0 .../macros/relations/materialized_view/create.sql | 0 .../macros/relations/materialized_view/drop.sql | 0 .../macros/relations/materialized_view/refresh.sql | 0 .../macros/relations/materialized_view/rename.sql | 0 .../macros/relations/materialized_view/replace.sql | 0 .../include/global_project/macros/relations/rename.sql | 0 .../global_project/macros/relations/rename_intermediate.sql | 0 .../include/global_project/macros/relations/replace.sql | 0 .../include/global_project/macros/relations/table/create.sql | 0 .../include/global_project/macros/relations/table/drop.sql | 0 .../include/global_project/macros/relations/table/rename.sql | 0 .../include/global_project/macros/relations/table/replace.sql | 0 .../include/global_project/macros/relations/view/create.sql | 0 .../include/global_project/macros/relations/view/drop.sql | 0 .../include/global_project/macros/relations/view/rename.sql | 0 .../include/global_project/macros/relations/view/replace.sql | 0 .../include/global_project/macros/utils/any_value.sql | 0 .../include/global_project/macros/utils/array_append.sql | 0 .../include/global_project/macros/utils/array_concat.sql | 0 .../include/global_project/macros/utils/array_construct.sql | 0 .../include/global_project/macros/utils/bool_or.sql | 0 .../include/global_project/macros/utils/cast_bool_to_text.sql | 0 .../include/global_project/macros/utils/concat.sql | 0 .../include/global_project/macros/utils/data_types.sql | 0 .../include/global_project/macros/utils/date_spine.sql | 0 .../include/global_project/macros/utils/date_trunc.sql | 0 .../include/global_project/macros/utils/dateadd.sql | 0 .../include/global_project/macros/utils/datediff.sql | 0 .../global_project/macros/utils/escape_single_quotes.sql | 0 .../include/global_project/macros/utils/except.sql | 0 .../include/global_project/macros/utils/generate_series.sql | 0 .../include/global_project/macros/utils/hash.sql | 0 .../include/global_project/macros/utils/intersect.sql | 0 .../include/global_project/macros/utils/last_day.sql | 0 .../include/global_project/macros/utils/length.sql | 0 .../include/global_project/macros/utils/listagg.sql | 0 .../include/global_project/macros/utils/literal.sql | 0 .../include/global_project/macros/utils/position.sql | 0 .../include/global_project/macros/utils/replace.sql | 0 .../include/global_project/macros/utils/right.sql | 0 .../include/global_project/macros/utils/safe_cast.sql | 0 .../include/global_project/macros/utils/split_part.sql | 0 .../include/global_project/tests/generic/builtin.sql | 0 core/dbt/context/macro_resolver.py | 2 +- core/dbt/context/macros.py | 2 +- core/dbt/task/generate.py | 2 +- core/dbt/task/init.py | 2 +- core/dbt/task/serve.py | 2 +- tests/functional/docs/test_static.py | 2 +- tests/unit/test_adapter_factory.py | 2 +- 105 files changed, 9 insertions(+), 9 deletions(-) rename core/dbt/{ => adapters}/include/global_project/__init__.py (100%) rename core/dbt/{ => adapters}/include/global_project/dbt_project.yml (100%) rename core/dbt/{ => adapters}/include/global_project/docs/overview.md (100%) rename core/dbt/{ => adapters}/include/global_project/macros/adapters/apply_grants.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/adapters/columns.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/adapters/freshness.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/adapters/indexes.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/adapters/metadata.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/adapters/persist_docs.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/adapters/relation.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/adapters/schema.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/adapters/show.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/adapters/timestamps.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/adapters/validate_sql.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/etc/datetime.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/etc/statement.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/generic_test_sql/accepted_values.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/generic_test_sql/not_null.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/generic_test_sql/relationships.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/generic_test_sql/unique.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/get_custom_name/get_custom_alias.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/get_custom_name/get_custom_database.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/get_custom_name/get_custom_schema.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/materializations/configs.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/materializations/hooks.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/materializations/models/clone/can_clone_table.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/materializations/models/clone/clone.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/materializations/models/clone/create_or_replace_clone.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/materializations/models/incremental/column_helpers.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/materializations/models/incremental/incremental.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/materializations/models/incremental/is_incremental.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/materializations/models/incremental/merge.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/materializations/models/incremental/on_schema_change.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/materializations/models/incremental/strategies.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/materializations/models/materialized_view.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/materializations/models/table.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/materializations/models/view.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/materializations/seeds/helpers.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/materializations/seeds/seed.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/materializations/snapshots/helpers.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/materializations/snapshots/snapshot.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/materializations/snapshots/snapshot_merge.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/materializations/snapshots/strategies.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/materializations/tests/helpers.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/materializations/tests/test.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/materializations/tests/where_subquery.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/python_model/python.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/relations/column/columns_spec_ddl.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/relations/create.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/relations/create_backup.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/relations/create_intermediate.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/relations/drop.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/relations/drop_backup.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/relations/materialized_view/alter.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/relations/materialized_view/create.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/relations/materialized_view/drop.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/relations/materialized_view/refresh.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/relations/materialized_view/rename.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/relations/materialized_view/replace.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/relations/rename.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/relations/rename_intermediate.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/relations/replace.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/relations/table/create.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/relations/table/drop.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/relations/table/rename.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/relations/table/replace.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/relations/view/create.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/relations/view/drop.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/relations/view/rename.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/relations/view/replace.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/any_value.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/array_append.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/array_concat.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/array_construct.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/bool_or.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/cast_bool_to_text.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/concat.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/data_types.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/date_spine.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/date_trunc.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/dateadd.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/datediff.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/escape_single_quotes.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/except.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/generate_series.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/hash.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/intersect.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/last_day.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/length.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/listagg.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/literal.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/position.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/replace.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/right.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/safe_cast.sql (100%) rename core/dbt/{ => adapters}/include/global_project/macros/utils/split_part.sql (100%) rename core/dbt/{ => adapters}/include/global_project/tests/generic/builtin.sql (100%) diff --git a/core/dbt/adapters/factory.py b/core/dbt/adapters/factory.py index 370239a38ff..724b9c0ba53 100644 --- a/core/dbt/adapters/factory.py +++ b/core/dbt/adapters/factory.py @@ -11,8 +11,8 @@ from dbt.common.events.functions import fire_event from dbt.common.events.types import AdapterImportError, PluginLoadError, AdapterRegistered from dbt.exceptions import DbtInternalError, DbtRuntimeError -from dbt.include.global_project import PACKAGE_PATH as GLOBAL_PROJECT_PATH -from dbt.include.global_project import PROJECT_NAME as GLOBAL_PROJECT_NAME +from dbt.adapters.include.global_project import PACKAGE_PATH as GLOBAL_PROJECT_PATH +from dbt.adapters.include.global_project import PROJECT_NAME as GLOBAL_PROJECT_NAME from dbt.semver import VersionSpecifier Adapter = AdapterProtocol diff --git a/core/dbt/include/global_project/__init__.py b/core/dbt/adapters/include/global_project/__init__.py similarity index 100% rename from core/dbt/include/global_project/__init__.py rename to core/dbt/adapters/include/global_project/__init__.py diff --git a/core/dbt/include/global_project/dbt_project.yml b/core/dbt/adapters/include/global_project/dbt_project.yml similarity index 100% rename from core/dbt/include/global_project/dbt_project.yml rename to core/dbt/adapters/include/global_project/dbt_project.yml diff --git a/core/dbt/include/global_project/docs/overview.md b/core/dbt/adapters/include/global_project/docs/overview.md similarity index 100% rename from core/dbt/include/global_project/docs/overview.md rename to core/dbt/adapters/include/global_project/docs/overview.md diff --git a/core/dbt/include/global_project/macros/adapters/apply_grants.sql b/core/dbt/adapters/include/global_project/macros/adapters/apply_grants.sql similarity index 100% rename from core/dbt/include/global_project/macros/adapters/apply_grants.sql rename to core/dbt/adapters/include/global_project/macros/adapters/apply_grants.sql diff --git a/core/dbt/include/global_project/macros/adapters/columns.sql b/core/dbt/adapters/include/global_project/macros/adapters/columns.sql similarity index 100% rename from core/dbt/include/global_project/macros/adapters/columns.sql rename to core/dbt/adapters/include/global_project/macros/adapters/columns.sql diff --git a/core/dbt/include/global_project/macros/adapters/freshness.sql b/core/dbt/adapters/include/global_project/macros/adapters/freshness.sql similarity index 100% rename from core/dbt/include/global_project/macros/adapters/freshness.sql rename to core/dbt/adapters/include/global_project/macros/adapters/freshness.sql diff --git a/core/dbt/include/global_project/macros/adapters/indexes.sql b/core/dbt/adapters/include/global_project/macros/adapters/indexes.sql similarity index 100% rename from core/dbt/include/global_project/macros/adapters/indexes.sql rename to core/dbt/adapters/include/global_project/macros/adapters/indexes.sql diff --git a/core/dbt/include/global_project/macros/adapters/metadata.sql b/core/dbt/adapters/include/global_project/macros/adapters/metadata.sql similarity index 100% rename from core/dbt/include/global_project/macros/adapters/metadata.sql rename to core/dbt/adapters/include/global_project/macros/adapters/metadata.sql diff --git a/core/dbt/include/global_project/macros/adapters/persist_docs.sql b/core/dbt/adapters/include/global_project/macros/adapters/persist_docs.sql similarity index 100% rename from core/dbt/include/global_project/macros/adapters/persist_docs.sql rename to core/dbt/adapters/include/global_project/macros/adapters/persist_docs.sql diff --git a/core/dbt/include/global_project/macros/adapters/relation.sql b/core/dbt/adapters/include/global_project/macros/adapters/relation.sql similarity index 100% rename from core/dbt/include/global_project/macros/adapters/relation.sql rename to core/dbt/adapters/include/global_project/macros/adapters/relation.sql diff --git a/core/dbt/include/global_project/macros/adapters/schema.sql b/core/dbt/adapters/include/global_project/macros/adapters/schema.sql similarity index 100% rename from core/dbt/include/global_project/macros/adapters/schema.sql rename to core/dbt/adapters/include/global_project/macros/adapters/schema.sql diff --git a/core/dbt/include/global_project/macros/adapters/show.sql b/core/dbt/adapters/include/global_project/macros/adapters/show.sql similarity index 100% rename from core/dbt/include/global_project/macros/adapters/show.sql rename to core/dbt/adapters/include/global_project/macros/adapters/show.sql diff --git a/core/dbt/include/global_project/macros/adapters/timestamps.sql b/core/dbt/adapters/include/global_project/macros/adapters/timestamps.sql similarity index 100% rename from core/dbt/include/global_project/macros/adapters/timestamps.sql rename to core/dbt/adapters/include/global_project/macros/adapters/timestamps.sql diff --git a/core/dbt/include/global_project/macros/adapters/validate_sql.sql b/core/dbt/adapters/include/global_project/macros/adapters/validate_sql.sql similarity index 100% rename from core/dbt/include/global_project/macros/adapters/validate_sql.sql rename to core/dbt/adapters/include/global_project/macros/adapters/validate_sql.sql diff --git a/core/dbt/include/global_project/macros/etc/datetime.sql b/core/dbt/adapters/include/global_project/macros/etc/datetime.sql similarity index 100% rename from core/dbt/include/global_project/macros/etc/datetime.sql rename to core/dbt/adapters/include/global_project/macros/etc/datetime.sql diff --git a/core/dbt/include/global_project/macros/etc/statement.sql b/core/dbt/adapters/include/global_project/macros/etc/statement.sql similarity index 100% rename from core/dbt/include/global_project/macros/etc/statement.sql rename to core/dbt/adapters/include/global_project/macros/etc/statement.sql diff --git a/core/dbt/include/global_project/macros/generic_test_sql/accepted_values.sql b/core/dbt/adapters/include/global_project/macros/generic_test_sql/accepted_values.sql similarity index 100% rename from core/dbt/include/global_project/macros/generic_test_sql/accepted_values.sql rename to core/dbt/adapters/include/global_project/macros/generic_test_sql/accepted_values.sql diff --git a/core/dbt/include/global_project/macros/generic_test_sql/not_null.sql b/core/dbt/adapters/include/global_project/macros/generic_test_sql/not_null.sql similarity index 100% rename from core/dbt/include/global_project/macros/generic_test_sql/not_null.sql rename to core/dbt/adapters/include/global_project/macros/generic_test_sql/not_null.sql diff --git a/core/dbt/include/global_project/macros/generic_test_sql/relationships.sql b/core/dbt/adapters/include/global_project/macros/generic_test_sql/relationships.sql similarity index 100% rename from core/dbt/include/global_project/macros/generic_test_sql/relationships.sql rename to core/dbt/adapters/include/global_project/macros/generic_test_sql/relationships.sql diff --git a/core/dbt/include/global_project/macros/generic_test_sql/unique.sql b/core/dbt/adapters/include/global_project/macros/generic_test_sql/unique.sql similarity index 100% rename from core/dbt/include/global_project/macros/generic_test_sql/unique.sql rename to core/dbt/adapters/include/global_project/macros/generic_test_sql/unique.sql diff --git a/core/dbt/include/global_project/macros/get_custom_name/get_custom_alias.sql b/core/dbt/adapters/include/global_project/macros/get_custom_name/get_custom_alias.sql similarity index 100% rename from core/dbt/include/global_project/macros/get_custom_name/get_custom_alias.sql rename to core/dbt/adapters/include/global_project/macros/get_custom_name/get_custom_alias.sql diff --git a/core/dbt/include/global_project/macros/get_custom_name/get_custom_database.sql b/core/dbt/adapters/include/global_project/macros/get_custom_name/get_custom_database.sql similarity index 100% rename from core/dbt/include/global_project/macros/get_custom_name/get_custom_database.sql rename to core/dbt/adapters/include/global_project/macros/get_custom_name/get_custom_database.sql diff --git a/core/dbt/include/global_project/macros/get_custom_name/get_custom_schema.sql b/core/dbt/adapters/include/global_project/macros/get_custom_name/get_custom_schema.sql similarity index 100% rename from core/dbt/include/global_project/macros/get_custom_name/get_custom_schema.sql rename to core/dbt/adapters/include/global_project/macros/get_custom_name/get_custom_schema.sql diff --git a/core/dbt/include/global_project/macros/materializations/configs.sql b/core/dbt/adapters/include/global_project/macros/materializations/configs.sql similarity index 100% rename from core/dbt/include/global_project/macros/materializations/configs.sql rename to core/dbt/adapters/include/global_project/macros/materializations/configs.sql diff --git a/core/dbt/include/global_project/macros/materializations/hooks.sql b/core/dbt/adapters/include/global_project/macros/materializations/hooks.sql similarity index 100% rename from core/dbt/include/global_project/macros/materializations/hooks.sql rename to core/dbt/adapters/include/global_project/macros/materializations/hooks.sql diff --git a/core/dbt/include/global_project/macros/materializations/models/clone/can_clone_table.sql b/core/dbt/adapters/include/global_project/macros/materializations/models/clone/can_clone_table.sql similarity index 100% rename from core/dbt/include/global_project/macros/materializations/models/clone/can_clone_table.sql rename to core/dbt/adapters/include/global_project/macros/materializations/models/clone/can_clone_table.sql diff --git a/core/dbt/include/global_project/macros/materializations/models/clone/clone.sql b/core/dbt/adapters/include/global_project/macros/materializations/models/clone/clone.sql similarity index 100% rename from core/dbt/include/global_project/macros/materializations/models/clone/clone.sql rename to core/dbt/adapters/include/global_project/macros/materializations/models/clone/clone.sql diff --git a/core/dbt/include/global_project/macros/materializations/models/clone/create_or_replace_clone.sql b/core/dbt/adapters/include/global_project/macros/materializations/models/clone/create_or_replace_clone.sql similarity index 100% rename from core/dbt/include/global_project/macros/materializations/models/clone/create_or_replace_clone.sql rename to core/dbt/adapters/include/global_project/macros/materializations/models/clone/create_or_replace_clone.sql diff --git a/core/dbt/include/global_project/macros/materializations/models/incremental/column_helpers.sql b/core/dbt/adapters/include/global_project/macros/materializations/models/incremental/column_helpers.sql similarity index 100% rename from core/dbt/include/global_project/macros/materializations/models/incremental/column_helpers.sql rename to core/dbt/adapters/include/global_project/macros/materializations/models/incremental/column_helpers.sql diff --git a/core/dbt/include/global_project/macros/materializations/models/incremental/incremental.sql b/core/dbt/adapters/include/global_project/macros/materializations/models/incremental/incremental.sql similarity index 100% rename from core/dbt/include/global_project/macros/materializations/models/incremental/incremental.sql rename to core/dbt/adapters/include/global_project/macros/materializations/models/incremental/incremental.sql diff --git a/core/dbt/include/global_project/macros/materializations/models/incremental/is_incremental.sql b/core/dbt/adapters/include/global_project/macros/materializations/models/incremental/is_incremental.sql similarity index 100% rename from core/dbt/include/global_project/macros/materializations/models/incremental/is_incremental.sql rename to core/dbt/adapters/include/global_project/macros/materializations/models/incremental/is_incremental.sql diff --git a/core/dbt/include/global_project/macros/materializations/models/incremental/merge.sql b/core/dbt/adapters/include/global_project/macros/materializations/models/incremental/merge.sql similarity index 100% rename from core/dbt/include/global_project/macros/materializations/models/incremental/merge.sql rename to core/dbt/adapters/include/global_project/macros/materializations/models/incremental/merge.sql diff --git a/core/dbt/include/global_project/macros/materializations/models/incremental/on_schema_change.sql b/core/dbt/adapters/include/global_project/macros/materializations/models/incremental/on_schema_change.sql similarity index 100% rename from core/dbt/include/global_project/macros/materializations/models/incremental/on_schema_change.sql rename to core/dbt/adapters/include/global_project/macros/materializations/models/incremental/on_schema_change.sql diff --git a/core/dbt/include/global_project/macros/materializations/models/incremental/strategies.sql b/core/dbt/adapters/include/global_project/macros/materializations/models/incremental/strategies.sql similarity index 100% rename from core/dbt/include/global_project/macros/materializations/models/incremental/strategies.sql rename to core/dbt/adapters/include/global_project/macros/materializations/models/incremental/strategies.sql diff --git a/core/dbt/include/global_project/macros/materializations/models/materialized_view.sql b/core/dbt/adapters/include/global_project/macros/materializations/models/materialized_view.sql similarity index 100% rename from core/dbt/include/global_project/macros/materializations/models/materialized_view.sql rename to core/dbt/adapters/include/global_project/macros/materializations/models/materialized_view.sql diff --git a/core/dbt/include/global_project/macros/materializations/models/table.sql b/core/dbt/adapters/include/global_project/macros/materializations/models/table.sql similarity index 100% rename from core/dbt/include/global_project/macros/materializations/models/table.sql rename to core/dbt/adapters/include/global_project/macros/materializations/models/table.sql diff --git a/core/dbt/include/global_project/macros/materializations/models/view.sql b/core/dbt/adapters/include/global_project/macros/materializations/models/view.sql similarity index 100% rename from core/dbt/include/global_project/macros/materializations/models/view.sql rename to core/dbt/adapters/include/global_project/macros/materializations/models/view.sql diff --git a/core/dbt/include/global_project/macros/materializations/seeds/helpers.sql b/core/dbt/adapters/include/global_project/macros/materializations/seeds/helpers.sql similarity index 100% rename from core/dbt/include/global_project/macros/materializations/seeds/helpers.sql rename to core/dbt/adapters/include/global_project/macros/materializations/seeds/helpers.sql diff --git a/core/dbt/include/global_project/macros/materializations/seeds/seed.sql b/core/dbt/adapters/include/global_project/macros/materializations/seeds/seed.sql similarity index 100% rename from core/dbt/include/global_project/macros/materializations/seeds/seed.sql rename to core/dbt/adapters/include/global_project/macros/materializations/seeds/seed.sql diff --git a/core/dbt/include/global_project/macros/materializations/snapshots/helpers.sql b/core/dbt/adapters/include/global_project/macros/materializations/snapshots/helpers.sql similarity index 100% rename from core/dbt/include/global_project/macros/materializations/snapshots/helpers.sql rename to core/dbt/adapters/include/global_project/macros/materializations/snapshots/helpers.sql diff --git a/core/dbt/include/global_project/macros/materializations/snapshots/snapshot.sql b/core/dbt/adapters/include/global_project/macros/materializations/snapshots/snapshot.sql similarity index 100% rename from core/dbt/include/global_project/macros/materializations/snapshots/snapshot.sql rename to core/dbt/adapters/include/global_project/macros/materializations/snapshots/snapshot.sql diff --git a/core/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql b/core/dbt/adapters/include/global_project/macros/materializations/snapshots/snapshot_merge.sql similarity index 100% rename from core/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql rename to core/dbt/adapters/include/global_project/macros/materializations/snapshots/snapshot_merge.sql diff --git a/core/dbt/include/global_project/macros/materializations/snapshots/strategies.sql b/core/dbt/adapters/include/global_project/macros/materializations/snapshots/strategies.sql similarity index 100% rename from core/dbt/include/global_project/macros/materializations/snapshots/strategies.sql rename to core/dbt/adapters/include/global_project/macros/materializations/snapshots/strategies.sql diff --git a/core/dbt/include/global_project/macros/materializations/tests/helpers.sql b/core/dbt/adapters/include/global_project/macros/materializations/tests/helpers.sql similarity index 100% rename from core/dbt/include/global_project/macros/materializations/tests/helpers.sql rename to core/dbt/adapters/include/global_project/macros/materializations/tests/helpers.sql diff --git a/core/dbt/include/global_project/macros/materializations/tests/test.sql b/core/dbt/adapters/include/global_project/macros/materializations/tests/test.sql similarity index 100% rename from core/dbt/include/global_project/macros/materializations/tests/test.sql rename to core/dbt/adapters/include/global_project/macros/materializations/tests/test.sql diff --git a/core/dbt/include/global_project/macros/materializations/tests/where_subquery.sql b/core/dbt/adapters/include/global_project/macros/materializations/tests/where_subquery.sql similarity index 100% rename from core/dbt/include/global_project/macros/materializations/tests/where_subquery.sql rename to core/dbt/adapters/include/global_project/macros/materializations/tests/where_subquery.sql diff --git a/core/dbt/include/global_project/macros/python_model/python.sql b/core/dbt/adapters/include/global_project/macros/python_model/python.sql similarity index 100% rename from core/dbt/include/global_project/macros/python_model/python.sql rename to core/dbt/adapters/include/global_project/macros/python_model/python.sql diff --git a/core/dbt/include/global_project/macros/relations/column/columns_spec_ddl.sql b/core/dbt/adapters/include/global_project/macros/relations/column/columns_spec_ddl.sql similarity index 100% rename from core/dbt/include/global_project/macros/relations/column/columns_spec_ddl.sql rename to core/dbt/adapters/include/global_project/macros/relations/column/columns_spec_ddl.sql diff --git a/core/dbt/include/global_project/macros/relations/create.sql b/core/dbt/adapters/include/global_project/macros/relations/create.sql similarity index 100% rename from core/dbt/include/global_project/macros/relations/create.sql rename to core/dbt/adapters/include/global_project/macros/relations/create.sql diff --git a/core/dbt/include/global_project/macros/relations/create_backup.sql b/core/dbt/adapters/include/global_project/macros/relations/create_backup.sql similarity index 100% rename from core/dbt/include/global_project/macros/relations/create_backup.sql rename to core/dbt/adapters/include/global_project/macros/relations/create_backup.sql diff --git a/core/dbt/include/global_project/macros/relations/create_intermediate.sql b/core/dbt/adapters/include/global_project/macros/relations/create_intermediate.sql similarity index 100% rename from core/dbt/include/global_project/macros/relations/create_intermediate.sql rename to core/dbt/adapters/include/global_project/macros/relations/create_intermediate.sql diff --git a/core/dbt/include/global_project/macros/relations/drop.sql b/core/dbt/adapters/include/global_project/macros/relations/drop.sql similarity index 100% rename from core/dbt/include/global_project/macros/relations/drop.sql rename to core/dbt/adapters/include/global_project/macros/relations/drop.sql diff --git a/core/dbt/include/global_project/macros/relations/drop_backup.sql b/core/dbt/adapters/include/global_project/macros/relations/drop_backup.sql similarity index 100% rename from core/dbt/include/global_project/macros/relations/drop_backup.sql rename to core/dbt/adapters/include/global_project/macros/relations/drop_backup.sql diff --git a/core/dbt/include/global_project/macros/relations/materialized_view/alter.sql b/core/dbt/adapters/include/global_project/macros/relations/materialized_view/alter.sql similarity index 100% rename from core/dbt/include/global_project/macros/relations/materialized_view/alter.sql rename to core/dbt/adapters/include/global_project/macros/relations/materialized_view/alter.sql diff --git a/core/dbt/include/global_project/macros/relations/materialized_view/create.sql b/core/dbt/adapters/include/global_project/macros/relations/materialized_view/create.sql similarity index 100% rename from core/dbt/include/global_project/macros/relations/materialized_view/create.sql rename to core/dbt/adapters/include/global_project/macros/relations/materialized_view/create.sql diff --git a/core/dbt/include/global_project/macros/relations/materialized_view/drop.sql b/core/dbt/adapters/include/global_project/macros/relations/materialized_view/drop.sql similarity index 100% rename from core/dbt/include/global_project/macros/relations/materialized_view/drop.sql rename to core/dbt/adapters/include/global_project/macros/relations/materialized_view/drop.sql diff --git a/core/dbt/include/global_project/macros/relations/materialized_view/refresh.sql b/core/dbt/adapters/include/global_project/macros/relations/materialized_view/refresh.sql similarity index 100% rename from core/dbt/include/global_project/macros/relations/materialized_view/refresh.sql rename to core/dbt/adapters/include/global_project/macros/relations/materialized_view/refresh.sql diff --git a/core/dbt/include/global_project/macros/relations/materialized_view/rename.sql b/core/dbt/adapters/include/global_project/macros/relations/materialized_view/rename.sql similarity index 100% rename from core/dbt/include/global_project/macros/relations/materialized_view/rename.sql rename to core/dbt/adapters/include/global_project/macros/relations/materialized_view/rename.sql diff --git a/core/dbt/include/global_project/macros/relations/materialized_view/replace.sql b/core/dbt/adapters/include/global_project/macros/relations/materialized_view/replace.sql similarity index 100% rename from core/dbt/include/global_project/macros/relations/materialized_view/replace.sql rename to core/dbt/adapters/include/global_project/macros/relations/materialized_view/replace.sql diff --git a/core/dbt/include/global_project/macros/relations/rename.sql b/core/dbt/adapters/include/global_project/macros/relations/rename.sql similarity index 100% rename from core/dbt/include/global_project/macros/relations/rename.sql rename to core/dbt/adapters/include/global_project/macros/relations/rename.sql diff --git a/core/dbt/include/global_project/macros/relations/rename_intermediate.sql b/core/dbt/adapters/include/global_project/macros/relations/rename_intermediate.sql similarity index 100% rename from core/dbt/include/global_project/macros/relations/rename_intermediate.sql rename to core/dbt/adapters/include/global_project/macros/relations/rename_intermediate.sql diff --git a/core/dbt/include/global_project/macros/relations/replace.sql b/core/dbt/adapters/include/global_project/macros/relations/replace.sql similarity index 100% rename from core/dbt/include/global_project/macros/relations/replace.sql rename to core/dbt/adapters/include/global_project/macros/relations/replace.sql diff --git a/core/dbt/include/global_project/macros/relations/table/create.sql b/core/dbt/adapters/include/global_project/macros/relations/table/create.sql similarity index 100% rename from core/dbt/include/global_project/macros/relations/table/create.sql rename to core/dbt/adapters/include/global_project/macros/relations/table/create.sql diff --git a/core/dbt/include/global_project/macros/relations/table/drop.sql b/core/dbt/adapters/include/global_project/macros/relations/table/drop.sql similarity index 100% rename from core/dbt/include/global_project/macros/relations/table/drop.sql rename to core/dbt/adapters/include/global_project/macros/relations/table/drop.sql diff --git a/core/dbt/include/global_project/macros/relations/table/rename.sql b/core/dbt/adapters/include/global_project/macros/relations/table/rename.sql similarity index 100% rename from core/dbt/include/global_project/macros/relations/table/rename.sql rename to core/dbt/adapters/include/global_project/macros/relations/table/rename.sql diff --git a/core/dbt/include/global_project/macros/relations/table/replace.sql b/core/dbt/adapters/include/global_project/macros/relations/table/replace.sql similarity index 100% rename from core/dbt/include/global_project/macros/relations/table/replace.sql rename to core/dbt/adapters/include/global_project/macros/relations/table/replace.sql diff --git a/core/dbt/include/global_project/macros/relations/view/create.sql b/core/dbt/adapters/include/global_project/macros/relations/view/create.sql similarity index 100% rename from core/dbt/include/global_project/macros/relations/view/create.sql rename to core/dbt/adapters/include/global_project/macros/relations/view/create.sql diff --git a/core/dbt/include/global_project/macros/relations/view/drop.sql b/core/dbt/adapters/include/global_project/macros/relations/view/drop.sql similarity index 100% rename from core/dbt/include/global_project/macros/relations/view/drop.sql rename to core/dbt/adapters/include/global_project/macros/relations/view/drop.sql diff --git a/core/dbt/include/global_project/macros/relations/view/rename.sql b/core/dbt/adapters/include/global_project/macros/relations/view/rename.sql similarity index 100% rename from core/dbt/include/global_project/macros/relations/view/rename.sql rename to core/dbt/adapters/include/global_project/macros/relations/view/rename.sql diff --git a/core/dbt/include/global_project/macros/relations/view/replace.sql b/core/dbt/adapters/include/global_project/macros/relations/view/replace.sql similarity index 100% rename from core/dbt/include/global_project/macros/relations/view/replace.sql rename to core/dbt/adapters/include/global_project/macros/relations/view/replace.sql diff --git a/core/dbt/include/global_project/macros/utils/any_value.sql b/core/dbt/adapters/include/global_project/macros/utils/any_value.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/any_value.sql rename to core/dbt/adapters/include/global_project/macros/utils/any_value.sql diff --git a/core/dbt/include/global_project/macros/utils/array_append.sql b/core/dbt/adapters/include/global_project/macros/utils/array_append.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/array_append.sql rename to core/dbt/adapters/include/global_project/macros/utils/array_append.sql diff --git a/core/dbt/include/global_project/macros/utils/array_concat.sql b/core/dbt/adapters/include/global_project/macros/utils/array_concat.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/array_concat.sql rename to core/dbt/adapters/include/global_project/macros/utils/array_concat.sql diff --git a/core/dbt/include/global_project/macros/utils/array_construct.sql b/core/dbt/adapters/include/global_project/macros/utils/array_construct.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/array_construct.sql rename to core/dbt/adapters/include/global_project/macros/utils/array_construct.sql diff --git a/core/dbt/include/global_project/macros/utils/bool_or.sql b/core/dbt/adapters/include/global_project/macros/utils/bool_or.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/bool_or.sql rename to core/dbt/adapters/include/global_project/macros/utils/bool_or.sql diff --git a/core/dbt/include/global_project/macros/utils/cast_bool_to_text.sql b/core/dbt/adapters/include/global_project/macros/utils/cast_bool_to_text.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/cast_bool_to_text.sql rename to core/dbt/adapters/include/global_project/macros/utils/cast_bool_to_text.sql diff --git a/core/dbt/include/global_project/macros/utils/concat.sql b/core/dbt/adapters/include/global_project/macros/utils/concat.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/concat.sql rename to core/dbt/adapters/include/global_project/macros/utils/concat.sql diff --git a/core/dbt/include/global_project/macros/utils/data_types.sql b/core/dbt/adapters/include/global_project/macros/utils/data_types.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/data_types.sql rename to core/dbt/adapters/include/global_project/macros/utils/data_types.sql diff --git a/core/dbt/include/global_project/macros/utils/date_spine.sql b/core/dbt/adapters/include/global_project/macros/utils/date_spine.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/date_spine.sql rename to core/dbt/adapters/include/global_project/macros/utils/date_spine.sql diff --git a/core/dbt/include/global_project/macros/utils/date_trunc.sql b/core/dbt/adapters/include/global_project/macros/utils/date_trunc.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/date_trunc.sql rename to core/dbt/adapters/include/global_project/macros/utils/date_trunc.sql diff --git a/core/dbt/include/global_project/macros/utils/dateadd.sql b/core/dbt/adapters/include/global_project/macros/utils/dateadd.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/dateadd.sql rename to core/dbt/adapters/include/global_project/macros/utils/dateadd.sql diff --git a/core/dbt/include/global_project/macros/utils/datediff.sql b/core/dbt/adapters/include/global_project/macros/utils/datediff.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/datediff.sql rename to core/dbt/adapters/include/global_project/macros/utils/datediff.sql diff --git a/core/dbt/include/global_project/macros/utils/escape_single_quotes.sql b/core/dbt/adapters/include/global_project/macros/utils/escape_single_quotes.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/escape_single_quotes.sql rename to core/dbt/adapters/include/global_project/macros/utils/escape_single_quotes.sql diff --git a/core/dbt/include/global_project/macros/utils/except.sql b/core/dbt/adapters/include/global_project/macros/utils/except.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/except.sql rename to core/dbt/adapters/include/global_project/macros/utils/except.sql diff --git a/core/dbt/include/global_project/macros/utils/generate_series.sql b/core/dbt/adapters/include/global_project/macros/utils/generate_series.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/generate_series.sql rename to core/dbt/adapters/include/global_project/macros/utils/generate_series.sql diff --git a/core/dbt/include/global_project/macros/utils/hash.sql b/core/dbt/adapters/include/global_project/macros/utils/hash.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/hash.sql rename to core/dbt/adapters/include/global_project/macros/utils/hash.sql diff --git a/core/dbt/include/global_project/macros/utils/intersect.sql b/core/dbt/adapters/include/global_project/macros/utils/intersect.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/intersect.sql rename to core/dbt/adapters/include/global_project/macros/utils/intersect.sql diff --git a/core/dbt/include/global_project/macros/utils/last_day.sql b/core/dbt/adapters/include/global_project/macros/utils/last_day.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/last_day.sql rename to core/dbt/adapters/include/global_project/macros/utils/last_day.sql diff --git a/core/dbt/include/global_project/macros/utils/length.sql b/core/dbt/adapters/include/global_project/macros/utils/length.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/length.sql rename to core/dbt/adapters/include/global_project/macros/utils/length.sql diff --git a/core/dbt/include/global_project/macros/utils/listagg.sql b/core/dbt/adapters/include/global_project/macros/utils/listagg.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/listagg.sql rename to core/dbt/adapters/include/global_project/macros/utils/listagg.sql diff --git a/core/dbt/include/global_project/macros/utils/literal.sql b/core/dbt/adapters/include/global_project/macros/utils/literal.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/literal.sql rename to core/dbt/adapters/include/global_project/macros/utils/literal.sql diff --git a/core/dbt/include/global_project/macros/utils/position.sql b/core/dbt/adapters/include/global_project/macros/utils/position.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/position.sql rename to core/dbt/adapters/include/global_project/macros/utils/position.sql diff --git a/core/dbt/include/global_project/macros/utils/replace.sql b/core/dbt/adapters/include/global_project/macros/utils/replace.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/replace.sql rename to core/dbt/adapters/include/global_project/macros/utils/replace.sql diff --git a/core/dbt/include/global_project/macros/utils/right.sql b/core/dbt/adapters/include/global_project/macros/utils/right.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/right.sql rename to core/dbt/adapters/include/global_project/macros/utils/right.sql diff --git a/core/dbt/include/global_project/macros/utils/safe_cast.sql b/core/dbt/adapters/include/global_project/macros/utils/safe_cast.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/safe_cast.sql rename to core/dbt/adapters/include/global_project/macros/utils/safe_cast.sql diff --git a/core/dbt/include/global_project/macros/utils/split_part.sql b/core/dbt/adapters/include/global_project/macros/utils/split_part.sql similarity index 100% rename from core/dbt/include/global_project/macros/utils/split_part.sql rename to core/dbt/adapters/include/global_project/macros/utils/split_part.sql diff --git a/core/dbt/include/global_project/tests/generic/builtin.sql b/core/dbt/adapters/include/global_project/tests/generic/builtin.sql similarity index 100% rename from core/dbt/include/global_project/tests/generic/builtin.sql rename to core/dbt/adapters/include/global_project/tests/generic/builtin.sql diff --git a/core/dbt/context/macro_resolver.py b/core/dbt/context/macro_resolver.py index d897c754049..dbeaf53ed78 100644 --- a/core/dbt/context/macro_resolver.py +++ b/core/dbt/context/macro_resolver.py @@ -1,7 +1,7 @@ from typing import Dict, MutableMapping, Optional from dbt.contracts.graph.nodes import Macro from dbt.exceptions import DuplicateMacroNameError, PackageNotFoundForMacroError -from dbt.include.global_project import PROJECT_NAME as GLOBAL_PROJECT_NAME +from dbt.adapters.include.global_project import PROJECT_NAME as GLOBAL_PROJECT_NAME from dbt.clients.jinja import MacroGenerator MacroNamespace = Dict[str, Macro] diff --git a/core/dbt/context/macros.py b/core/dbt/context/macros.py index 1c61e564e06..f37aa02d20f 100644 --- a/core/dbt/context/macros.py +++ b/core/dbt/context/macros.py @@ -2,7 +2,7 @@ from dbt.clients.jinja import MacroGenerator, MacroStack from dbt.contracts.graph.nodes import Macro -from dbt.include.global_project import PROJECT_NAME as GLOBAL_PROJECT_NAME +from dbt.adapters.include.global_project import PROJECT_NAME as GLOBAL_PROJECT_NAME from dbt.exceptions import DuplicateMacroNameError, PackageNotFoundForMacroError diff --git a/core/dbt/task/generate.py b/core/dbt/task/generate.py index 076f1c68764..527a2cd676a 100644 --- a/core/dbt/task/generate.py +++ b/core/dbt/task/generate.py @@ -27,7 +27,7 @@ from dbt.exceptions import DbtInternalError, AmbiguousCatalogMatchError from dbt.graph import ResourceTypeSelector from dbt.node_types import NodeType -from dbt.include.global_project import DOCS_INDEX_FILE_PATH +from dbt.adapters.include.global_project import DOCS_INDEX_FILE_PATH from dbt.common.events.functions import fire_event from dbt.common.events.types import ( WriteCatalogFailure, diff --git a/core/dbt/task/init.py b/core/dbt/task/init.py index 5a41b3f122d..0d2d713b717 100644 --- a/core/dbt/task/init.py +++ b/core/dbt/task/init.py @@ -34,7 +34,7 @@ from dbt.include.starter_project import PACKAGE_PATH as starter_project_directory -from dbt.include.global_project import PROJECT_NAME as GLOBAL_PROJECT_NAME +from dbt.adapters.include.global_project import PROJECT_NAME as GLOBAL_PROJECT_NAME from dbt.task.base import BaseTask, move_to_nearest_project_dir diff --git a/core/dbt/task/serve.py b/core/dbt/task/serve.py index 060c4c93d17..18d0b7b0015 100644 --- a/core/dbt/task/serve.py +++ b/core/dbt/task/serve.py @@ -6,7 +6,7 @@ import click -from dbt.include.global_project import DOCS_INDEX_FILE_PATH +from dbt.adapters.include.global_project import DOCS_INDEX_FILE_PATH from dbt.task.base import ConfiguredTask diff --git a/tests/functional/docs/test_static.py b/tests/functional/docs/test_static.py index 2196db779be..835b53ba195 100644 --- a/tests/functional/docs/test_static.py +++ b/tests/functional/docs/test_static.py @@ -1,7 +1,7 @@ import pytest from dbt.clients.system import load_file_contents -from dbt.include.global_project import DOCS_INDEX_FILE_PATH +from dbt.adapters.include.global_project import DOCS_INDEX_FILE_PATH from dbt.tests.util import run_dbt import os diff --git a/tests/unit/test_adapter_factory.py b/tests/unit/test_adapter_factory.py index c67b61d7fc0..49974d14dfb 100644 --- a/tests/unit/test_adapter_factory.py +++ b/tests/unit/test_adapter_factory.py @@ -3,7 +3,7 @@ from unittest import mock from dbt.adapters.factory import AdapterContainer from dbt.adapters.base.plugin import AdapterPlugin -from dbt.include.global_project import ( +from dbt.adapters.include.global_project import ( PROJECT_NAME as GLOBAL_PROJECT_NAME, ) From 60938533336b7ba2d7ca0f251bed3a3eddddceb4 Mon Sep 17 00:00:00 2001 From: Michelle Ark Date: Thu, 26 Oct 2023 18:49:59 -0400 Subject: [PATCH 2/6] changelog entry --- .changes/unreleased/Under the Hood-20231026-184953.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changes/unreleased/Under the Hood-20231026-184953.yaml diff --git a/.changes/unreleased/Under the Hood-20231026-184953.yaml b/.changes/unreleased/Under the Hood-20231026-184953.yaml new file mode 100644 index 00000000000..cdfbf25be5f --- /dev/null +++ b/.changes/unreleased/Under the Hood-20231026-184953.yaml @@ -0,0 +1,6 @@ +kind: Under the Hood +body: Remove usage of dbt.include.global_project in dbt/adapters +time: 2023-10-26T18:49:53.36449-04:00 +custom: + Author: michelleark + Issue: "8925" From 38929d34c5b1834a5ccfd0ee7a6e62e9d227258f Mon Sep 17 00:00:00 2001 From: Michelle Ark Date: Thu, 26 Oct 2023 21:32:13 -0400 Subject: [PATCH 3/6] define DOCS_INDEX_FILE_PATH in dbt.task.generate, move index.html top-level --- core/dbt/adapters/include/global_project/__init__.py | 2 -- core/dbt/{include => }/index.html | 0 core/dbt/task/generate.py | 4 +++- core/dbt/task/serve.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename core/dbt/{include => }/index.html (100%) diff --git a/core/dbt/adapters/include/global_project/__init__.py b/core/dbt/adapters/include/global_project/__init__.py index 1ef0113c7d8..4043ffebb6e 100644 --- a/core/dbt/adapters/include/global_project/__init__.py +++ b/core/dbt/adapters/include/global_project/__init__.py @@ -2,5 +2,3 @@ PACKAGE_PATH = os.path.dirname(__file__) PROJECT_NAME = "dbt" - -DOCS_INDEX_FILE_PATH = os.path.normpath(os.path.join(PACKAGE_PATH, "..", "index.html")) diff --git a/core/dbt/include/index.html b/core/dbt/index.html similarity index 100% rename from core/dbt/include/index.html rename to core/dbt/index.html diff --git a/core/dbt/task/generate.py b/core/dbt/task/generate.py index 527a2cd676a..7e540a2651b 100644 --- a/core/dbt/task/generate.py +++ b/core/dbt/task/generate.py @@ -27,7 +27,6 @@ from dbt.exceptions import DbtInternalError, AmbiguousCatalogMatchError from dbt.graph import ResourceTypeSelector from dbt.node_types import NodeType -from dbt.adapters.include.global_project import DOCS_INDEX_FILE_PATH from dbt.common.events.functions import fire_event from dbt.common.events.types import ( WriteCatalogFailure, @@ -44,6 +43,9 @@ ) CATALOG_FILENAME = "catalog.json" +DOCS_INDEX_FILE_PATH = os.path.normpath( + os.path.join(os.path.dirname(__file__), "..", "index.html") +) def get_stripped_prefix(source: Dict[str, Any], prefix: str) -> Dict[str, Any]: diff --git a/core/dbt/task/serve.py b/core/dbt/task/serve.py index 18d0b7b0015..4907b9828da 100644 --- a/core/dbt/task/serve.py +++ b/core/dbt/task/serve.py @@ -6,7 +6,7 @@ import click -from dbt.adapters.include.global_project import DOCS_INDEX_FILE_PATH +from dbt.task.generate import DOCS_INDEX_FILE_PATH from dbt.task.base import ConfiguredTask From 6cdae262c817182516a445420b337823ce79d65c Mon Sep 17 00:00:00 2001 From: Michelle Ark Date: Tue, 21 Nov 2023 19:45:57 -0500 Subject: [PATCH 4/6] fix test_static import --- tests/functional/docs/test_static.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/docs/test_static.py b/tests/functional/docs/test_static.py index 835b53ba195..4b31800ede5 100644 --- a/tests/functional/docs/test_static.py +++ b/tests/functional/docs/test_static.py @@ -1,7 +1,7 @@ import pytest from dbt.clients.system import load_file_contents -from dbt.adapters.include.global_project import DOCS_INDEX_FILE_PATH +from dbt.task.generate import DOCS_INDEX_FILE_PATH from dbt.tests.util import run_dbt import os From d90f2c69be6a7d934453969e0bb3b6cfdc6dfd81 Mon Sep 17 00:00:00 2001 From: Michelle Ark Date: Tue, 21 Nov 2023 20:46:23 -0500 Subject: [PATCH 5/6] move index.html to task/docs --- .gitattributes | 2 +- ARCHITECTURE.md | 2 +- core/dbt/cli/main.py | 4 +- core/dbt/index.html | 102 ----------- core/dbt/task/docs/__init__.py | 3 + core/dbt/task/{ => docs}/generate.py | 6 +- core/dbt/task/docs/index.html | 255 +++++++++++++++++++++++++++ core/dbt/task/{ => docs}/serve.py | 2 +- core/dbt/task/retry.py | 2 +- tests/functional/docs/test_static.py | 2 +- tests/unit/test_docs_generate.py | 4 +- 11 files changed, 269 insertions(+), 115 deletions(-) delete mode 100644 core/dbt/index.html create mode 100644 core/dbt/task/docs/__init__.py rename core/dbt/task/{ => docs}/generate.py (98%) create mode 100644 core/dbt/task/docs/index.html rename core/dbt/task/{ => docs}/serve.py (93%) diff --git a/.gitattributes b/.gitattributes index 2cc23be887c..b963dbdc1c5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ -core/dbt/include/index.html binary +core/dbt/task/docs/index.html binary tests/functional/artifacts/data/state/*/manifest.json binary core/dbt/docs/build/html/searchindex.js binary core/dbt/docs/build/html/index.html binary diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index e689d32f2ee..5373f780aa1 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -26,7 +26,7 @@ Legacy tests are found in the 'test' directory: The "tasks" map to top-level dbt commands. So `dbt run` => task.run.RunTask, etc. Some are more like abstract base classes (GraphRunnableTask, for example) but all the concrete types outside of task should map to tasks. Currently one executes at a time. The tasks kick off their “Runners” and those do execute in parallel. The parallelism is managed via a thread pool, in GraphRunnableTask. -core/dbt/include/index.html +core/dbt/task/docs/index.html This is the docs website code. It comes from the dbt-docs repository, and is generated when a release is packaged. ## Adapters diff --git a/core/dbt/cli/main.py b/core/dbt/cli/main.py index a19e1058903..06e19ac0b71 100644 --- a/core/dbt/cli/main.py +++ b/core/dbt/cli/main.py @@ -29,14 +29,14 @@ from dbt.task.debug import DebugTask from dbt.task.deps import DepsTask from dbt.task.freshness import FreshnessTask -from dbt.task.generate import GenerateTask +from dbt.task.docs.generate import GenerateTask from dbt.task.init import InitTask from dbt.task.list import ListTask from dbt.task.retry import RetryTask from dbt.task.run import RunTask from dbt.task.run_operation import RunOperationTask from dbt.task.seed import SeedTask -from dbt.task.serve import ServeTask +from dbt.task.docs.serve import ServeTask from dbt.task.show import ShowTask from dbt.task.snapshot import SnapshotTask from dbt.task.test import TestTask diff --git a/core/dbt/index.html b/core/dbt/index.html deleted file mode 100644 index ca1e6f8832d..00000000000 --- a/core/dbt/index.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - dbt Docs - - - - - - - - - - - - - - - - - -
icons
-
- - diff --git a/core/dbt/task/docs/__init__.py b/core/dbt/task/docs/__init__.py new file mode 100644 index 00000000000..3cd9e13e846 --- /dev/null +++ b/core/dbt/task/docs/__init__.py @@ -0,0 +1,3 @@ +import os + +DOCS_INDEX_FILE_PATH = os.path.normpath(os.path.join(os.path.dirname(__file__), "index.html")) diff --git a/core/dbt/task/generate.py b/core/dbt/task/docs/generate.py similarity index 98% rename from core/dbt/task/generate.py rename to core/dbt/task/docs/generate.py index 9aa9f4c4c2f..71496dea2a3 100644 --- a/core/dbt/task/generate.py +++ b/core/dbt/task/docs/generate.py @@ -7,7 +7,8 @@ from dbt.common.dataclass_schema import ValidationError from dbt.clients.system import load_file_contents -from .compile import CompileTask +from dbt.task.docs import DOCS_INDEX_FILE_PATH +from dbt.task.compile import CompileTask from dbt.adapters.factory import get_adapter from dbt.contracts.graph.nodes import ResultNode @@ -44,9 +45,6 @@ ) CATALOG_FILENAME = "catalog.json" -DOCS_INDEX_FILE_PATH = os.path.normpath( - os.path.join(os.path.dirname(__file__), "..", "index.html") -) def get_stripped_prefix(source: Dict[str, Any], prefix: str) -> Dict[str, Any]: diff --git a/core/dbt/task/docs/index.html b/core/dbt/task/docs/index.html new file mode 100644 index 00000000000..3da725b2e59 --- /dev/null +++ b/core/dbt/task/docs/index.html @@ -0,0 +1,255 @@ + + + + + + + + dbt Docs + + + + + + + + + + + + + + + + + + +
+ icons + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + diff --git a/core/dbt/task/serve.py b/core/dbt/task/docs/serve.py similarity index 93% rename from core/dbt/task/serve.py rename to core/dbt/task/docs/serve.py index 4907b9828da..c3e6fda61fa 100644 --- a/core/dbt/task/serve.py +++ b/core/dbt/task/docs/serve.py @@ -6,7 +6,7 @@ import click -from dbt.task.generate import DOCS_INDEX_FILE_PATH +from dbt.task.docs import DOCS_INDEX_FILE_PATH from dbt.task.base import ConfiguredTask diff --git a/core/dbt/task/retry.py b/core/dbt/task/retry.py index a982880adaa..f02381b789f 100644 --- a/core/dbt/task/retry.py +++ b/core/dbt/task/retry.py @@ -11,7 +11,7 @@ from dbt.task.build import BuildTask from dbt.task.clone import CloneTask from dbt.task.compile import CompileTask -from dbt.task.generate import GenerateTask +from dbt.task.docs.generate import GenerateTask from dbt.task.run import RunTask from dbt.task.run_operation import RunOperationTask from dbt.task.seed import SeedTask diff --git a/tests/functional/docs/test_static.py b/tests/functional/docs/test_static.py index 4b31800ede5..ad820c36fc2 100644 --- a/tests/functional/docs/test_static.py +++ b/tests/functional/docs/test_static.py @@ -1,7 +1,7 @@ import pytest from dbt.clients.system import load_file_contents -from dbt.task.generate import DOCS_INDEX_FILE_PATH +from dbt.task.docs import DOCS_INDEX_FILE_PATH from dbt.tests.util import run_dbt import os diff --git a/tests/unit/test_docs_generate.py b/tests/unit/test_docs_generate.py index 8daf767e96b..25cb2655a72 100644 --- a/tests/unit/test_docs_generate.py +++ b/tests/unit/test_docs_generate.py @@ -2,14 +2,14 @@ from unittest import mock import unittest -from dbt.task import generate +from dbt.task.docs import generate class GenerateTest(unittest.TestCase): def setUp(self): self.maxDiff = None self.manifest = mock.MagicMock() - self.patcher = mock.patch("dbt.task.generate.get_unique_id_mapping") + self.patcher = mock.patch("dbt.task.docs.generate.get_unique_id_mapping") self.mock_get_unique_id_mapping = self.patcher.start() def tearDown(self): From 0c30c351298f27177a5968d0b60ee8e6e1474aa0 Mon Sep 17 00:00:00 2001 From: Michelle Ark Date: Mon, 27 Nov 2023 17:42:32 -0500 Subject: [PATCH 6/6] reorder imports alphabetically --- core/dbt/cli/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/dbt/cli/main.py b/core/dbt/cli/main.py index 06e19ac0b71..03a6cbfb01c 100644 --- a/core/dbt/cli/main.py +++ b/core/dbt/cli/main.py @@ -28,15 +28,15 @@ from dbt.task.compile import CompileTask from dbt.task.debug import DebugTask from dbt.task.deps import DepsTask -from dbt.task.freshness import FreshnessTask from dbt.task.docs.generate import GenerateTask +from dbt.task.docs.serve import ServeTask +from dbt.task.freshness import FreshnessTask from dbt.task.init import InitTask from dbt.task.list import ListTask from dbt.task.retry import RetryTask from dbt.task.run import RunTask from dbt.task.run_operation import RunOperationTask from dbt.task.seed import SeedTask -from dbt.task.docs.serve import ServeTask from dbt.task.show import ShowTask from dbt.task.snapshot import SnapshotTask from dbt.task.test import TestTask