Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20260216-230817.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Use resolved profile and target names to allow partial parsing for default profile and target
time: 2026-02-16T23:08:17.820862+05:30
custom:
Author: akshatha-code71 ash2shukla
Issue: "7612"
8 changes: 4 additions & 4 deletions core/dbt/parser/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1034,8 +1034,8 @@ def build_manifest_state_check(self):
"\x00".join(
[
stringified_cli_vars,
getattr(config.args, "profile", "") or "",
getattr(config.args, "target", "") or "",
config.profile_name,
config.target_name,
__version__,
]
)
Expand All @@ -1044,8 +1044,8 @@ def build_manifest_state_check(self):
StateCheckVarsHash(
checksum=vars_hash.checksum,
vars=scrub_secrets(stringified_cli_vars, secret_vars),
profile=config.args.profile,
target=config.args.target,
profile=config.profile_name,
target=config.target_name,
version=__version__,
)
)
Expand Down
16 changes: 16 additions & 0 deletions tests/functional/partial_parsing/test_partial_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import dbt.flags as flags
from dbt.contracts.files import ParseFileType
from dbt.contracts.results import TestStatus
from dbt.events.types import UnableToPartialParse
from dbt.exceptions import CompilationError
from dbt.plugins.manifest import ModelNodeArgs, PluginNodes
from dbt.tests.fixtures.project import write_project_files
Expand All @@ -20,6 +21,7 @@
run_dbt_and_capture,
write_file,
)
from dbt_common.events.event_catcher import EventCatcher
from tests.functional.partial_parsing.fixtures import (
custom_schema_tests1_sql,
custom_schema_tests2_sql,
Expand Down Expand Up @@ -996,3 +998,17 @@ def test_profile_change(self, project, dbt_profile_data):
write_file(yaml.safe_dump(dbt_profile_data), project.profiles_dir, "profiles.yml")
_, stdout = run_dbt_and_capture(["parse"])
assert "Unable to do partial parsing" not in stdout


class TestExplicitDefaultProfileAndTarget:
def test_explicit_default_profile_allows_partial_parse(self, project):
event_catcher = EventCatcher(UnableToPartialParse)
run_dbt(["parse"])
run_dbt(["parse", "--profile", "test"], callbacks=[event_catcher.catch])
assert len(event_catcher.caught_events) == 0

def test_explicit_default_target_allows_partial_parse(self, project):
event_catcher = EventCatcher(UnableToPartialParse)
run_dbt(["parse"])
run_dbt(["parse", "--target", "default"], callbacks=[event_catcher.catch])
assert len(event_catcher.caught_events) == 0
2 changes: 2 additions & 0 deletions tests/unit/utils/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ def mock_project():
mock_project = MagicMock(RuntimeConfig)
mock_project.cli_vars = {}
mock_project.args = MagicMock()
mock_project.profile_name = "test"
mock_project.target_name = "test"
mock_project.args.profile = "test"
mock_project.args.target = "test"
mock_project.project_env_vars = {}
Expand Down