Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
nits
  • Loading branch information
ChenyuLInx committed Jul 7, 2023
commit 12d95410b776b5c6e681da19d4250ff89a6e61e3
2 changes: 1 addition & 1 deletion core/dbt/parser/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ def read_manifest_for_partial_parse(self) -> Optional[Manifest]:
if not flags.PARTIAL_PARSE:
fire_event(PartialParsingNotEnabled())
return None
path = flags.partial_parse_file_path or os.path.join(
path = flags.PARTIAL_PARSE_FILE_PATH or os.path.join(
self.root_project.project_target_path, PARTIAL_PARSE_FILE_NAME
)

Expand Down
8 changes: 5 additions & 3 deletions tests/unit/test_parse_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,16 @@ def _new_file(self, searched, name, match):
class TestPartialParse(unittest.TestCase):
@patch("dbt.parser.manifest.ManifestLoader.build_manifest_state_check")
@patch("dbt.parser.manifest.os.path.exists")
def test_partial_parse_file_path(self, patched_os_exist, patched_state_check):
@patch("dbt.parser.manifest.open")
def test_partial_parse_file_path(self, patched_open, patched_os_exist, patched_state_check):
mock_project = MagicMock(RuntimeConfig)
mock_project.project_target_path = "mock_target_path"
patched_os_exist.return_value = True
set_from_args(Namespace(), {})
ManifestLoader(mock_project, {})
# by default we use the project_target_path
patched_os_exist.assert_called_with("mock_target_path/partial_parse.msgpack")
patched_open.assert_called_with("mock_target_path/partial_parse.msgpack", "rb")
set_from_args(Namespace(partial_parse_file_path="specified_partial_parse_path"), {})
ManifestLoader(mock_project, {})
# if specified in flags, we use the specified path
patched_os_exist.assert_called_with("specified_partial_parse_path")
patched_open.assert_called_with("specified_partial_parse_path", "rb")