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" 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/adapters/factory.py b/core/dbt/adapters/factory.py index 79d6564aa0f..f79585ecd1d 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.adapters.events.types import AdapterImportError, PluginLoadError, AdapterRegistered from dbt.common.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 from dbt.mp_context import get_mp_context diff --git a/core/dbt/adapters/include/global_project/__init__.py b/core/dbt/adapters/include/global_project/__init__.py new file mode 100644 index 00000000000..4043ffebb6e --- /dev/null +++ b/core/dbt/adapters/include/global_project/__init__.py @@ -0,0 +1,4 @@ +import os + +PACKAGE_PATH = os.path.dirname(__file__) +PROJECT_NAME = "dbt" 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/schema.sql b/core/dbt/adapters/include/global_project/macros/relations/schema.sql similarity index 100% rename from core/dbt/include/global_project/macros/relations/schema.sql rename to core/dbt/adapters/include/global_project/macros/relations/schema.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/cli/main.py b/core/dbt/cli/main.py index a19e1058903..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.docs.generate import GenerateTask +from dbt.task.docs.serve import ServeTask from dbt.task.freshness import FreshnessTask -from dbt.task.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.show import ShowTask from dbt.task.snapshot import SnapshotTask from dbt.task.test import TestTask 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/include/global_project/__init__.py b/core/dbt/include/global_project/__init__.py deleted file mode 100644 index 1ef0113c7d8..00000000000 --- a/core/dbt/include/global_project/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -import os - -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/include/index.html deleted file mode 100644 index ca1e6f8832d..00000000000 --- a/core/dbt/include/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 99% rename from core/dbt/task/generate.py rename to core/dbt/task/docs/generate.py index ceff4033275..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 @@ -28,7 +29,6 @@ from dbt.exceptions import AmbiguousCatalogMatchError from dbt.graph import ResourceTypeSelector from dbt.node_types import NodeType -from dbt.include.global_project import DOCS_INDEX_FILE_PATH from dbt.common.events.functions import fire_event from dbt.adapters.events.types import ( WriteCatalogFailure, 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 060c4c93d17..c3e6fda61fa 100644 --- a/core/dbt/task/serve.py +++ b/core/dbt/task/docs/serve.py @@ -6,7 +6,7 @@ import click -from dbt.include.global_project 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/init.py b/core/dbt/task/init.py index 11fe14406b8..483cdd991bc 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/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 2196db779be..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.include.global_project 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_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, ) 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):