Skip to content

Commit

Permalink
Merge branch 'release_24.1' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Jun 18, 2024
2 parents ce6f746 + ed2369f commit f1893e2
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 5 deletions.
2 changes: 2 additions & 0 deletions client/src/api/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6155,6 +6155,8 @@ export interface components {
* @enum {string}
*/
model_class: "HistoryDatasetAssociation";
/** Purged */
purged: boolean;
/**
* State
* @description The current state of this dataset.
Expand Down
1 change: 1 addition & 0 deletions client/src/stores/collectionElementsStore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ function mockElement(collectionId: string, i: number): DCESummary {
history_id: "1",
tags: [],
accessible: true,
purged: false,
},
};
}
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/managers/collections_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ def dictify_element_reference(
else:
object_details["state"] = element_object.state
object_details["hda_ldda"] = "hda"
object_details["purged"] = element_object.purged
if isinstance(element_object, model.HistoryDatasetAssociation):
object_details["history_id"] = element_object.history_id
object_details["tags"] = element_object.make_tag_string_list()
Expand Down
13 changes: 11 additions & 2 deletions lib/galaxy/managers/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
cast,
Dict,
List,
Optional,
)

import sqlalchemy
Expand All @@ -26,6 +27,7 @@
)
from sqlalchemy.orm import aliased
from sqlalchemy.sql import select
from typing_extensions import TypedDict

from galaxy import model
from galaxy.exceptions import (
Expand Down Expand Up @@ -824,7 +826,14 @@ def merge_states(component_states):
return rval


def summarize_jobs_to_dict(sa_session, jobs_source):
class JobsSummary(TypedDict):
populated_state: str
states: Dict[str, int]
model: str
id: int


def summarize_jobs_to_dict(sa_session, jobs_source) -> Optional[JobsSummary]:
"""Produce a summary of jobs for job summary endpoints.
:type jobs_source: a Job or ImplicitCollectionJobs or None
Expand All @@ -833,7 +842,7 @@ def summarize_jobs_to_dict(sa_session, jobs_source):
:rtype: dict
:returns: dictionary containing job summary information
"""
rval = None
rval: Optional[JobsSummary] = None
if jobs_source is None:
pass
elif isinstance(jobs_source, model.Job):
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/schema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,7 @@ class HDAObject(Model, WithModelClass):
tags: List[str]
copied_from_ldda_id: Optional[EncodedDatabaseIdField] = None
accessible: Optional[bool] = None
purged: bool
model_config = ConfigDict(extra="allow")


Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/tools/parameters/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def __init__(self, message, range_min, range_max, exclude_min=False, exclude_max
op1 = "<"
if self.exclude_max:
op2 = "<"
expression = f"float('{self.min}') {op1} value {op2} float('{self.max}')"
expression = f"float('{self.min}') {op1} float(value) {op2} float('{self.max}')"
if message is None:
message = f"Value ('%s') must {'not ' if negate == 'true' else ''}fulfill {expression}"
super().__init__(message, expression, negate)
Expand Down
4 changes: 2 additions & 2 deletions test/unit/app/tools/test_parameter_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,11 @@ def test_InRangeValidator(self):
)
p.validate(10)
with self.assertRaisesRegex(
ValueError, r"Parameter blah: Value \('15'\) must not fulfill float\('10'\) < value <= float\('20'\)"
ValueError, r"Parameter blah: Value \('15'\) must not fulfill float\('10'\) < float\(value\) <= float\('20'\)"
):
p.validate(15)
with self.assertRaisesRegex(
ValueError, r"Parameter blah: Value \('20'\) must not fulfill float\('10'\) < value <= float\('20'\)"
ValueError, r"Parameter blah: Value \('20'\) must not fulfill float\('10'\) < float\(value\) <= float\('20'\)"
):
p.validate(20)
p.validate(21)
Expand Down

0 comments on commit f1893e2

Please sign in to comment.