Skip to content

Commit

Permalink
FIX: Disable delete_local_files by default and provide in config
Browse files Browse the repository at this point in the history
  • Loading branch information
cortadocodes committed Jul 10, 2024
1 parent 3164def commit 9d5a282
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions octue/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class ServiceConfiguration:
:param str|None diagnostics_cloud_path: the path to a cloud directory to store diagnostics (this includes the configuration, input values and manifest, and logs for each question)
:param iter(dict)|None service_registries: the names and endpoints of the registries used to resolve service revisions when asking questions; these should be in priority order (highest priority first)
:param str|None event_store_table_id: the full ID of the Google BigQuery table used as the event store e.g. "your-project.your-dataset.your-table"
:param bool delete_local_files: if `True`, delete any files downloaded and temporary directories created during an analysis once it's finished
:param str|None directory: if provided, find the app source, twine, and app configuration relative to this directory
:return None:
"""
Expand All @@ -36,6 +37,7 @@ def __init__(
diagnostics_cloud_path=None,
service_registries=None,
event_store_table_id=None,
delete_local_files=False,
directory=None,
**kwargs,
):
Expand All @@ -44,6 +46,7 @@ def __init__(
self.diagnostics_cloud_path = diagnostics_cloud_path
self.service_registries = service_registries
self.event_store_table_id = event_store_table_id
self.delete_local_files = delete_local_files

if directory:
directory = os.path.abspath(directory)
Expand Down
5 changes: 3 additions & 2 deletions octue/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Runner:
:param str|None diagnostics_cloud_path: the path to a cloud directory to store diagnostics (this includes the configuration, input values and manifest, and logs for each question)
:param str|None project_name: name of Google Cloud project to get credentials from
:param str|None service_id: the ID of the service being run
:param bool delete_local_files: if `True`, delete any files downloaded during the call to `Runner.run` once the analysis has finished
:param bool delete_local_files: if `True`, delete any files downloaded and temporary directories created during an analysis once it's finished
:return None:
"""

Expand All @@ -63,7 +63,7 @@ def __init__(
project_name=None,
service_id=None,
service_registries=None,
delete_local_files=True,
delete_local_files=False,
):
self.app_source = app_src
self.children = children
Expand Down Expand Up @@ -135,6 +135,7 @@ def from_configuration(
"project_name": project_name,
"service_id": service_id,
"service_registries": service_configuration.service_registries,
"delete_local_files": service_configuration.delete_local_files,
}

inputs |= overrides
Expand Down

0 comments on commit 9d5a282

Please sign in to comment.