Skip to content

Commit

Permalink
reproduce: Update pull flag to also pull run cache, `data_sources…
Browse files Browse the repository at this point in the history
…` and `imports`.

Closes #4742
  • Loading branch information
daavoo committed Apr 27, 2023
1 parent baeec8e commit f470685
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion dvc/repo/reproduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def _track_stage(stage: "Stage") -> None:

@locked
@scm_context
def reproduce( # noqa: C901
def reproduce( # noqa: C901, PLR0912
self: "Repo",
targets=None,
recursive=False,
Expand Down Expand Up @@ -125,6 +125,10 @@ def reproduce( # noqa: C901
)
)

if kwargs.get("pull", False):
logger.debug("Pulling run cache")
self.stage_cache.pull(None)

return _reproduce_stages(self.index.graph, list(stages), **kwargs)


Expand Down Expand Up @@ -190,6 +194,10 @@ def _reproduce_stages( # noqa: C901
)

try:
if kwargs.get("pull", False) and stage.is_data_source or stage.is_import:
logger.debug("Pulling '%s'", stage.addressing)
stage.repo.pull(stage.addressing)

ret = _reproduce_stage(stage, **kwargs)

if len(ret) == 0:
Expand Down

0 comments on commit f470685

Please sign in to comment.