Skip to content

Commit 0420a1d

Browse files
authored
Merge pull request #21075 from jdavcs/dev_20981
Remove Job.params
2 parents 6af187b + 2f8829b commit 0420a1d

File tree

8 files changed

+37
-26
lines changed

8 files changed

+37
-26
lines changed

lib/galaxy/jobs/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,8 +1048,6 @@ def __init__(
10481048
self._job_io = None
10491049
self.tool_provided_job_metadata = None
10501050
self.params = None
1051-
if job.params:
1052-
self.params = loads(job.params)
10531051
self.runner_command_line = None
10541052

10551053
# Wrapper holding the info required to restore and clean up from files used for setting metadata externally

lib/galaxy/jobs/manager.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,10 @@ def enqueue(self, job, tool=None, flush=True):
6666
configured_handler = None
6767
if tool:
6868
tool_id = tool.id
69-
configured_handler = tool.get_configured_job_handler(job.params)
69+
configured_handler = tool.get_configured_job_handler()
7070
if configured_handler is not None:
71-
p = f" (with job params: {str(job.params)})" if job.params else ""
7271
log.debug(
73-
"(%s) Configured job handler for tool '%s'%s is: %s", job.log_str(), tool_id, p, configured_handler
72+
"(%s) Configured job handler for tool '%s' is: %s", job.log_str(), tool_id, configured_handler
7473
)
7574
queue_callback = partial(self._queue_callback, job, tool_id)
7675
message_callback = partial(self._message_callback, job)

lib/galaxy/jobs/runners/state_handlers/resubmit.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ def _handle_resubmit_definitions(resubmit_definitions, app, job_runner, job_stat
101101
# Clear external ID (state change below flushes the change)
102102
job.job_runner_external_id = None
103103
# Allow the UI to query for resubmitted state
104-
if job.params is None:
105-
job.params = {}
106104
job_state.runner_state_handled = True
107105
info = f"This job was resubmitted to the queue because {MESSAGES[runner_state]} on its compute resource."
108106
job_runner.mark_as_resubmitted(job_state, info=info)

lib/galaxy/model/__init__.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,7 +1584,6 @@ class Job(Base, JobLike, UsesCreateAndUpdateTime, Dictifiable, Serializable):
15841584
destination_params: Mapped[Optional[bytes]] = mapped_column(MutableJSONType)
15851585
object_store_id: Mapped[Optional[str]] = mapped_column(TrimmedString(255), index=True)
15861586
imported: Mapped[Optional[bool]] = mapped_column(default=False, index=True)
1587-
params: Mapped[Optional[str]] = mapped_column(TrimmedString(255), index=True)
15881587
handler: Mapped[Optional[str]] = mapped_column(TrimmedString(255), index=True)
15891588
preferred_object_store_id: Mapped[Optional[str]] = mapped_column(String(255))
15901589
object_store_id_overrides: Mapped[Optional[dict[str, Optional[str]]]] = mapped_column(JSONType)
@@ -1852,9 +1851,6 @@ def get_imported(self):
18521851
def get_handler(self):
18531852
return self.handler
18541853

1855-
def get_params(self):
1856-
return self.params
1857-
18581854
def get_user(self):
18591855
# This is defined in the SQL Alchemy mapper as a relation to the User.
18601856
return self.user
@@ -1941,9 +1937,6 @@ def set_imported(self, imported):
19411937
def set_handler(self, handler):
19421938
self.handler = handler
19431939

1944-
def set_params(self, params):
1945-
self.params = params
1946-
19471940
def add_parameter(self, name, value):
19481941
self.parameters.append(JobParameter(name, value))
19491942

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
"""Drop Job.params column
2+
3+
Revision ID: a5c5455b849a
4+
Revises: e382f8eb5e12
5+
Create Date: 2025-10-15 16:13:14.778789
6+
7+
"""
8+
9+
from sqlalchemy import Column
10+
11+
from galaxy.model.custom_types import TrimmedString
12+
from galaxy.model.migrations.util import (
13+
add_column,
14+
drop_column,
15+
)
16+
17+
# revision identifiers, used by Alembic.
18+
revision = "a5c5455b849a"
19+
down_revision = "e382f8eb5e12"
20+
branch_labels = None
21+
depends_on = None
22+
23+
table_name = "job"
24+
column_name = "params"
25+
26+
27+
def upgrade():
28+
drop_column(table_name, column_name)
29+
30+
31+
def downgrade():
32+
add_column(table_name, Column(column_name, TrimmedString(255)))

lib/galaxy/tools/__init__.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,18 +1248,15 @@ def __get_job_tool_configuration(self, job_params=None):
12481248
), f"Could not get a job tool configuration for Tool {self.id} with job_params {job_params}, this is a bug"
12491249
return rval
12501250

1251-
def get_configured_job_handler(self, job_params=None):
1252-
"""Get the configured job handler for this `Tool` given the provided `job_params`.
1251+
def get_configured_job_handler(self):
1252+
"""Get the configured job handler for this `Tool`.
12531253
12541254
Unlike the former ``get_job_handler()`` method, this does not perform "preassignment" (random selection of
12551255
a configured handler ID from a tag).
12561256
1257-
:param job_params: Any params specific to this job (e.g. the job source)
1258-
:type job_params: dict or None
1259-
12601257
:returns: str or None -- The configured handler for a job run of this `Tool`
12611258
"""
1262-
return self.__get_job_tool_configuration(job_params=job_params).handler
1259+
return self.__get_job_tool_configuration().handler
12631260

12641261
def get_job_destination(self, job_params=None):
12651262
"""

lib/galaxy/tools/actions/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
Mapping,
88
MutableMapping,
99
)
10-
from json import dumps
1110
from typing import (
1211
Any,
1312
cast,
@@ -744,8 +743,6 @@ def handle_output(name, output, hidden=None):
744743
# execute immediate post job actions and associate post job actions that are to be executed after the job is complete
745744
if job_callback:
746745
job_callback(job)
747-
if job_params:
748-
job.params = dumps(job_params)
749746
if completed_job:
750747
job.set_copied_from_job_id(completed_job.id)
751748
trans.sa_session.add(job)

lib/galaxy/tools/actions/metadata.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import logging
22
import os
3-
from json import dumps
43
from typing import (
54
Any,
65
Optional,
@@ -146,8 +145,6 @@ def execute_via_app(
146145
job.tool_id = tool.id
147146
if user:
148147
job.user_id = user.id
149-
if job_params:
150-
job.params = dumps(job_params)
151148
start_job_state = job.state # should be job.states.NEW
152149
try:
153150
# For backward compatibility, some tools may not have versions yet.

0 commit comments

Comments
 (0)