Skip to content

Commit

Permalink
Mark outputs skipped if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek authored and jmchilton committed Apr 15, 2024
1 parent bbfc604 commit 8807db4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
12 changes: 12 additions & 0 deletions lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
)
from galaxy.model.orm.now import now
from galaxy.model.orm.util import add_object_to_object_session
from galaxy.objectstore import ObjectStorePopulator
from galaxy.schema.invocation import (
InvocationCancellationUserRequest,
InvocationState,
Expand Down Expand Up @@ -4581,6 +4582,17 @@ def get_quota_source_label(self):

quota_source_label = property(get_quota_source_label)

def set_skipped(self, object_store_populator: ObjectStorePopulator):
assert self.dataset
object_store_populator.set_object_store_id(self)
self.extension = "expression.json"
self.state = self.states.OK
self.blurb = "skipped"
self.visible = False
with open(self.dataset.get_file_name(), "w") as out:
out.write(json.dumps(None))
self.set_total_size()

def get_file_name(self, sync_cache=True) -> str:
if self.dataset.purged:
return ""
Expand Down
9 changes: 1 addition & 8 deletions lib/galaxy/tools/actions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,14 +675,7 @@ def handle_output(name, output, hidden=None):
hdca.visible = False
object_store_populator = ObjectStorePopulator(trans.app, trans.user)
for data in out_data.values():
object_store_populator.set_object_store_id(data)
data.extension = "expression.json"
data.state = "ok"
data.blurb = "skipped"
data.visible = False
with open(data.dataset.get_file_name(), "w") as out:
out.write(json.dumps(None))
data.set_total_size()
data.set_skipped(object_store_populator)
job.preferred_object_store_id = preferred_object_store_id
self._record_inputs(trans, tool, job, incoming, inp_data, inp_dataset_collections)
self._record_outputs(job, out_data, output_collections)
Expand Down
7 changes: 5 additions & 2 deletions lib/galaxy/tools/actions/model_operations.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging
from typing import TYPE_CHECKING

from galaxy.objectstore import ObjectStorePopulator
from galaxy.tools.actions import (
DefaultToolAction,
OutputCollections,
Expand Down Expand Up @@ -137,8 +138,10 @@ def _produce_outputs(
if skip:
for output_collection in output_collections.out_collections.values():
output_collection.mark_as_populated()
object_store_populator = ObjectStorePopulator(trans.app, trans.user)
for hdca in output_collections.out_collection_instances.values():
hdca.visible = False
# Would we also need to replace the datasets with skipped datasets?

# Would we also need to replace the datasets with skipped datasets?
for data in hdca.dataset_instances:
data.set_skipped(object_store_populator)
trans.sa_session.add_all(out_data.values())

0 comments on commit 8807db4

Please sign in to comment.