diff --git a/core/dbt/task/init.py b/core/dbt/task/init.py index aa7e942c206..83f5f75d506 100644 --- a/core/dbt/task/init.py +++ b/core/dbt/task/init.py @@ -34,6 +34,9 @@ from dbt.task.base import BaseTask, move_to_nearest_project_dir +from dbt.include.starter_project import PACKAGE_PATH as starter_project_directory +from dbt.include.global_project import PROJECT_NAME as GLOBAL_PROJECT_NAME + DOCS_URL = "https://docs.getdbt.com/docs/configure-your-profile" SLACK_URL = "https://community.getdbt.com/" @@ -54,9 +57,6 @@ class InitTask(BaseTask): def copy_starter_repo(self, project_name: str) -> None: - # Lazy import to avoid ModuleNotFoundError - from dbt.include.starter_project import PACKAGE_PATH as starter_project_directory - fire_event(StarterProjectPath(dir=starter_project_directory)) shutil.copytree( starter_project_directory, project_name, ignore=shutil.ignore_patterns(*IGNORE_FILES) @@ -264,10 +264,6 @@ def setup_profile(self, profile_name: str) -> None: def get_valid_project_name(self) -> str: """Returns a valid project name, either from CLI arg or user prompt.""" - - # Lazy import to avoid ModuleNotFoundError - from dbt.include.global_project import PROJECT_NAME as GLOBAL_PROJECT_NAME - name = self.args.project_name internal_package_names = {GLOBAL_PROJECT_NAME} available_adapters = list(_get_adapter_plugin_names()) diff --git a/tests/unit/test_plugin_manager.py b/tests/unit/test_plugin_manager.py index 4cfe01d0dfc..38cdea002f9 100644 --- a/tests/unit/test_plugin_manager.py +++ b/tests/unit/test_plugin_manager.py @@ -101,7 +101,7 @@ def test_get_nodes(self, tracking, get_nodes_plugins): nodes = pm.get_nodes() assert len(nodes.models) == 2 - assert tracking.track_plugin_get_nodes.called_once_with( + tracking.track_plugin_get_nodes.assert_called_once_with( { "plugin_name": get_nodes_plugins[0].name, "num_model_nodes": 2,