diff --git a/python_modules/libraries/dagster-dbt/dagster_dbt/cli/app.py b/python_modules/libraries/dagster-dbt/dagster_dbt/cli/app.py index b8bfa15ca809b..bd1feea00fe67 100644 --- a/python_modules/libraries/dagster-dbt/dagster_dbt/cli/app.py +++ b/python_modules/libraries/dagster-dbt/dagster_dbt/cli/app.py @@ -303,7 +303,7 @@ def project_scaffold_command( ) -def prepare_for_deployment(project: DbtProject) -> None: +def prepare_and_package(project: DbtProject) -> None: """A method that can be called as part of the deployment process.""" if project.preparer: console.print( @@ -358,8 +358,8 @@ def sync_project_to_packaged_dir( console.print("Sync complete.") -@project_app.command(name="prepare-for-deployment") -def project_prepare_for_deployment_command( +@project_app.command(name="prepare-and-package") +def project_prepare_and_package_command( file: Annotated[ str, typer.Option( @@ -367,7 +367,7 @@ def project_prepare_for_deployment_command( ), ], ) -> None: - """This command will invoke ``prepare_for_deployment`` on :py:class:`DbtProject` found in the target module or file.""" + """This command will invoke ``prepare_and_package`` on :py:class:`DbtProject` found in the target module or file.""" console.print( f"Running with dagster-dbt version: [bold green]{dagster_dbt_version}[/bold green]." ) @@ -375,7 +375,7 @@ def project_prepare_for_deployment_command( contents = load_python_file(file, working_directory=None) dbt_projects: Iterator[DbtProject] = find_objects_in_module_of_types(contents, types=DbtProject) for project in dbt_projects: - prepare_for_deployment(project) + prepare_and_package(project) project_app_typer_click_object = typer.main.get_command(project_app) diff --git a/python_modules/libraries/dagster-dbt/dagster_dbt_tests/cli/test_prepare_for_deployment.py b/python_modules/libraries/dagster-dbt/dagster_dbt_tests/cli/test_prepare_and_package.py similarity index 93% rename from python_modules/libraries/dagster-dbt/dagster_dbt_tests/cli/test_prepare_for_deployment.py rename to python_modules/libraries/dagster-dbt/dagster_dbt_tests/cli/test_prepare_and_package.py index 7900bf7ca3d90..a38f7d89fa4b4 100644 --- a/python_modules/libraries/dagster-dbt/dagster_dbt_tests/cli/test_prepare_for_deployment.py +++ b/python_modules/libraries/dagster-dbt/dagster_dbt_tests/cli/test_prepare_and_package.py @@ -16,7 +16,7 @@ runner = CliRunner() -def test_prepare_for_deployment(monkeypatch: pytest.MonkeyPatch, dbt_project_dir: Path) -> None: +def test_prepare_and_package(monkeypatch: pytest.MonkeyPatch, dbt_project_dir: Path) -> None: monkeypatch.chdir(dbt_project_dir) project_name = "jaffle_dagster" @@ -47,7 +47,7 @@ def test_prepare_for_deployment(monkeypatch: pytest.MonkeyPatch, dbt_project_dir app, [ "project", - "prepare-for-deployment", + "prepare-and-package", "--file", os.fspath(dagster_project_dir.joinpath(project_name, "project.py")), ], @@ -58,7 +58,7 @@ def test_prepare_for_deployment(monkeypatch: pytest.MonkeyPatch, dbt_project_dir assert packaged_project_dir.exists() -def test_prepare_for_deployment_with_dependencies( +def test_prepare_and_package_with_dependencies( monkeypatch: pytest.MonkeyPatch, dbt_project_dir: Path ) -> None: monkeypatch.chdir(dbt_project_dir) @@ -105,7 +105,7 @@ def test_prepare_for_deployment_with_dependencies( app, [ "project", - "prepare-for-deployment", + "prepare-and-package", "--file", os.fspath(dagster_project_dir.joinpath(project_name, "project.py")), ], @@ -116,7 +116,7 @@ def test_prepare_for_deployment_with_dependencies( assert manifest_path.exists() -def test_prepare_for_deployment_with_packages( +def test_prepare_and_package_with_packages( monkeypatch: pytest.MonkeyPatch, dbt_project_dir: Path ) -> None: monkeypatch.chdir(dbt_project_dir) @@ -163,7 +163,7 @@ def test_prepare_for_deployment_with_packages( app, [ "project", - "prepare-for-deployment", + "prepare-and-package", "--file", os.fspath(dagster_project_dir.joinpath(project_name, "project.py")), ], @@ -174,7 +174,7 @@ def test_prepare_for_deployment_with_packages( assert manifest_path.exists() -def test_prepare_for_deployment_with_state( +def test_prepare_and_package_with_state( monkeypatch: pytest.MonkeyPatch, dbt_project_dir: Path ) -> None: monkeypatch.setenv("DAGSTER_DBT_JAFFLE_SCHEMA", "prod") @@ -201,7 +201,7 @@ def test_prepare_for_deployment_with_state( result = runner.invoke( app, - ["project", "prepare-for-deployment", "--file", os.fspath(dbt_project_file_path)], + ["project", "prepare-and-package", "--file", os.fspath(dbt_project_file_path)], ) assert result.exit_code == 0