diff --git a/lib/galaxy/jobs/runners/pulsar.py b/lib/galaxy/jobs/runners/pulsar.py index 45128847f55a..634e20675440 100644 --- a/lib/galaxy/jobs/runners/pulsar.py +++ b/lib/galaxy/jobs/runners/pulsar.py @@ -977,8 +977,8 @@ def __async_update(self, full_status): remote_job_id = full_status["job_id"] if len(remote_job_id) == 32: # It is a UUID - assign_ids = uuid in destination params... - stmt = select(model.Job).filter(model.Job.job_runner_external_id == remote_job_id) - galaxy_job_id = self.app.model.session.execute(stmt).scalar_one().id + stmt = select(model.Job.id).filter(model.Job.job_runner_external_id == remote_job_id) + galaxy_job_id = self.app.model.session.execute(stmt).scalar_one() else: galaxy_job_id = remote_job_id job, job_wrapper = self.app.job_manager.job_handler.job_queue.job_pair_for_id(galaxy_job_id) diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 337e5cf7791a..bdff421c3adb 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -11134,23 +11134,27 @@ def __repr__(self): # ---------------------------------------------------------------------------------------- # The following statements must not precede the mapped models defined above. -Job.any_output_dataset_collection_instances_deleted = column_property( - exists(HistoryDatasetCollectionAssociation.id).where( - and_( - Job.id == JobToOutputDatasetCollectionAssociation.job_id, - HistoryDatasetCollectionAssociation.id == JobToOutputDatasetCollectionAssociation.dataset_collection_id, - HistoryDatasetCollectionAssociation.deleted == true(), - ) +Job.any_output_dataset_collection_instances_deleted = deferred( + column_property( + exists(HistoryDatasetCollectionAssociation.id).where( + and_( + Job.id == JobToOutputDatasetCollectionAssociation.job_id, + HistoryDatasetCollectionAssociation.id == JobToOutputDatasetCollectionAssociation.dataset_collection_id, + HistoryDatasetCollectionAssociation.deleted == true(), + ) + ), ) ) -Job.any_output_dataset_deleted = column_property( - exists(HistoryDatasetAssociation.id).where( - and_( - Job.id == JobToOutputDatasetAssociation.job_id, - HistoryDatasetAssociation.table.c.id == JobToOutputDatasetAssociation.dataset_id, - HistoryDatasetAssociation.table.c.deleted == true(), - ) +Job.any_output_dataset_deleted = deferred( + column_property( + exists(HistoryDatasetAssociation.id).where( + and_( + Job.id == JobToOutputDatasetAssociation.job_id, + HistoryDatasetAssociation.table.c.id == JobToOutputDatasetAssociation.dataset_id, + HistoryDatasetAssociation.table.c.deleted == true(), + ) + ), ) )