Skip to content

Commit

Permalink
Requirements_cache shouldn't create a cache folder when skipped. (#31961
Browse files Browse the repository at this point in the history
)

* If the requirements cache is skipped then we shouldn't generate a requirements_cache folder.

* pre-commit

---------

Co-authored-by: eddiephillips <eddiephillips@google.com>
  • Loading branch information
eddiep24 and eddiephillips authored Jul 25, 2024
1 parent 496e712 commit b9a0c2b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sdks/python/apache_beam/runners/portability/stager.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ def create_job_resources(options, # type: PipelineOptions
os.path.join(tempfile.gettempdir(), 'dataflow-requirements-cache') if
(setup_options.requirements_cache is None) else
setup_options.requirements_cache)
if not os.path.exists(requirements_cache_path):
if (setup_options.requirements_cache != SKIP_REQUIREMENTS_CACHE and
not os.path.exists(requirements_cache_path)):
os.makedirs(requirements_cache_path)

# Stage a requirements file if present.
Expand Down

0 comments on commit b9a0c2b

Please sign in to comment.