diff --git a/docs/content/api/modules.json.gz b/docs/content/api/modules.json.gz index ca0913be7edf5..4205f0bb24491 100644 Binary files a/docs/content/api/modules.json.gz and b/docs/content/api/modules.json.gz differ diff --git a/docs/content/api/searchindex.json.gz b/docs/content/api/searchindex.json.gz index 50c71841386a3..40d198da6ef3a 100644 Binary files a/docs/content/api/searchindex.json.gz and b/docs/content/api/searchindex.json.gz differ diff --git a/docs/content/api/sections.json.gz b/docs/content/api/sections.json.gz index 5239d60d1bf3f..f87dff9ac2aa9 100644 Binary files a/docs/content/api/sections.json.gz and b/docs/content/api/sections.json.gz differ diff --git a/docs/next/public/objects.inv b/docs/next/public/objects.inv index 12467d6aff338..72dffb6c4622b 100644 Binary files a/docs/next/public/objects.inv and b/docs/next/public/objects.inv differ diff --git a/python_modules/libraries/dagster-dbt/dagster_dbt/dbt_project.py b/python_modules/libraries/dagster-dbt/dagster_dbt/dbt_project.py index b020b0df91f90..06f92d358d764 100644 --- a/python_modules/libraries/dagster-dbt/dagster_dbt/dbt_project.py +++ b/python_modules/libraries/dagster-dbt/dagster_dbt/dbt_project.py @@ -152,7 +152,7 @@ class DbtProject(IHaveNew): from dagster_dbt import DbtProject - my_project = DbtProject(project_dir=Path("path/to/dbt_project")).prepared() + my_project = DbtProject(project_dir=Path("path/to/dbt_project")).prepare() Creating a DbtProject that changes target based on environment variables and uses manged state artifacts: @@ -175,7 +175,7 @@ def get_env(): project_dir=Path('path/to/dbt_project'), state_path="target/managed_state", target=get_env(), - ).prepared() + ).prepare() """ @@ -240,7 +240,7 @@ def __new__( ) @public - def prepared(self) -> "DbtProject": + def prepare(self) -> "DbtProject": """Execute the preparation process for a dbt project and return the DbtProject object when complete. By default, the preparation process for DbtProject is the following: @@ -264,7 +264,7 @@ def prepared(self) -> "DbtProject": from dagster import Definitions from dagster_dbt import DbtProject - my_project = DbtProject(project_dir=Path("path/to/dbt_project")).prepared() + my_project = DbtProject(project_dir=Path("path/to/dbt_project")).prepare() defs = Definitions( resources={ @@ -284,7 +284,7 @@ def prepared(self) -> "DbtProject": my_project = DbtProject(project_dir=Path("path/to/dbt_project")) - @dbt_assets(manifest=my_project.prepared().manifest_path) + @dbt_assets(manifest=my_project.prepare().manifest_path) def my_dbt_asset(): ... """ diff --git a/python_modules/libraries/dagster-dbt/dagster_dbt/include/scaffold/assets.py.jinja b/python_modules/libraries/dagster-dbt/dagster_dbt/include/scaffold/assets.py.jinja index d2f95ed21e9b3..a91df9fbc98ad 100644 --- a/python_modules/libraries/dagster-dbt/dagster_dbt/include/scaffold/assets.py.jinja +++ b/python_modules/libraries/dagster-dbt/dagster_dbt/include/scaffold/assets.py.jinja @@ -8,7 +8,7 @@ from .constants import dbt_manifest_path {% endif %} {% if use_experimental_dbt_project -%} -@dbt_assets(manifest={{ dbt_project_name }}.prepared().manifest_path) +@dbt_assets(manifest={{ dbt_project_name }}.prepare().manifest_path) {% else -%} @dbt_assets(manifest=dbt_manifest_path) {% endif -%} diff --git a/python_modules/libraries/dagster-dbt/dagster_dbt_tests/core/test_project.py b/python_modules/libraries/dagster-dbt/dagster_dbt_tests/core/test_project.py index e6b4f6cc14619..972554a23c62a 100644 --- a/python_modules/libraries/dagster-dbt/dagster_dbt_tests/core/test_project.py +++ b/python_modules/libraries/dagster-dbt/dagster_dbt_tests/core/test_project.py @@ -30,9 +30,9 @@ def test_local_dev(project_dir) -> None: with pytest.raises(DagsterDbtManifestNotFoundError): # The preparation process will fail locally # if no env var are provided and the manifest does not exist - DbtProject(project_dir).prepared() + DbtProject(project_dir).prepare() with environ({"DAGSTER_IS_DEV_CLI": "1"}): - my_project = DbtProject(project_dir).prepared() + my_project = DbtProject(project_dir).prepare() assert my_project.manifest_path.exists() @@ -42,14 +42,14 @@ def test_opt_in_env_var(project_dir) -> None: with pytest.raises(DagsterDbtManifestNotFoundError): # The preparation process will fail locally # if no env var are provided and the manifest does not exist - DbtProject(project_dir).prepared() + DbtProject(project_dir).prepare() with environ({"DAGSTER_DBT_PARSE_PROJECT_ON_LOAD": "1"}): - my_project = DbtProject(project_dir).prepared() + my_project = DbtProject(project_dir).prepare() assert my_project.manifest_path.exists() def _init(project_dir): - my_project = DbtProject(project_dir).prepared() + my_project = DbtProject(project_dir).prepare() assert my_project.manifest_path.exists() assert validate_manifest(my_project.manifest_path) return @@ -61,7 +61,7 @@ def test_concurrent_processes(project_dir): with pytest.raises(DagsterDbtManifestNotFoundError): # The preparation process will fail locally # if no env var are provided and the manifest does not exist - DbtProject(project_dir).prepared() + DbtProject(project_dir).prepare() with environ({"DAGSTER_IS_DEV_CLI": "1"}): procs = [multiprocessing.Process(target=_init, args=(project_dir,)) for _ in range(4)] for proc in procs: diff --git a/python_modules/libraries/dagster-dbt/dagster_dbt_tests/core/test_resources_v2.py b/python_modules/libraries/dagster-dbt/dagster_dbt_tests/core/test_resources_v2.py index 0fdf6c84131f5..48f819fa1a712 100644 --- a/python_modules/libraries/dagster-dbt/dagster_dbt_tests/core/test_resources_v2.py +++ b/python_modules/libraries/dagster-dbt/dagster_dbt_tests/core/test_resources_v2.py @@ -458,7 +458,7 @@ def test_dbt_cli_defer_args(monkeypatch: pytest.MonkeyPatch, testrun_uid: str) - dbt.cli(["--quiet", "parse"], target_path=project.target_path).wait() - @dbt_assets(manifest=project.prepared().manifest_path) + @dbt_assets(manifest=project.prepare().manifest_path) def my_dbt_assets(context: AssetExecutionContext, dbt: DbtCliResource): yield from dbt.cli(["build", *dbt.get_defer_args()], context=context).stream()