diff --git a/client/src/api/schema/schema.ts b/client/src/api/schema/schema.ts index 7da851a70511..1e73e27175a7 100644 --- a/client/src/api/schema/schema.ts +++ b/client/src/api/schema/schema.ts @@ -8002,7 +8002,7 @@ export interface components { * Hash Function * @description The hash function used to generate the hash. */ - hash_function: components["schemas"]["HashFunctionNames"]; + hash_function: components["schemas"]["HashFunctionNameEnum"]; /** * Hash Value * @description The hash value. @@ -10868,16 +10868,10 @@ export interface components { }; /** * HashFunctionNameEnum - * @description Particular pieces of information that can be requested for a dataset. + * @description Hash function names that can be used to generate checksums for files. * @enum {string} */ HashFunctionNameEnum: "MD5" | "SHA-1" | "SHA-256" | "SHA-512"; - /** - * HashFunctionNames - * @description Hash function names that can be used to generate checksums for datasets. - * @enum {string} - */ - HashFunctionNames: "MD5" | "SHA-1" | "SHA-256" | "SHA-512"; /** HdaDestination */ HdaDestination: { /** diff --git a/lib/galaxy/schema/schema.py b/lib/galaxy/schema/schema.py index d1e05c577cec..3febee546896 100644 --- a/lib/galaxy/schema/schema.py +++ b/lib/galaxy/schema/schema.py @@ -50,6 +50,7 @@ OffsetNaiveDatetime, RelativeUrl, ) +from galaxy.util.hash_util import HashFunctionNameEnum from galaxy.util.sanitize_html import sanitize_html USER_MODEL_CLASS = Literal["User"] @@ -121,15 +122,6 @@ class DatasetCollectionPopulatedState(str, Enum): FAILED = "failed" # some problem populating state, won't be populated -class HashFunctionNames(str, Enum): - """Hash function names that can be used to generate checksums for datasets.""" - - md5 = "MD5" - sha1 = "SHA-1" - sha256 = "SHA-256" - sha512 = "SHA-512" - - # Generic and common Field annotations that can be reused across models RelativeUrlField = Annotated[ @@ -733,7 +725,7 @@ class DatasetHash(Model): title="ID", description="Encoded ID of the dataset hash.", ) - hash_function: HashFunctionNames = Field( + hash_function: HashFunctionNameEnum = Field( ..., title="Hash Function", description="The hash function used to generate the hash.", diff --git a/lib/galaxy/util/hash_util.py b/lib/galaxy/util/hash_util.py index efb5d0ce7e1b..addf26fb90bc 100644 --- a/lib/galaxy/util/hash_util.py +++ b/lib/galaxy/util/hash_util.py @@ -34,7 +34,7 @@ class HashFunctionNameEnum(str, Enum): - """Particular pieces of information that can be requested for a dataset.""" + """Hash function names that can be used to generate checksums for files.""" md5 = "MD5" sha1 = "SHA-1" diff --git a/lib/galaxy/webapps/galaxy/services/datasets.py b/lib/galaxy/webapps/galaxy/services/datasets.py index 4f6fef304697..20c22a720591 100644 --- a/lib/galaxy/webapps/galaxy/services/datasets.py +++ b/lib/galaxy/webapps/galaxy/services/datasets.py @@ -537,11 +537,11 @@ def get_drs_object(self, trans: ProvidesHistoryContext, object_id: str, request_ checksums.append(Checksum(type=type, checksum=checksum)) if len(checksums) == 0: - hash_funciton = HashFunctionNameEnum.md5 + hash_function = HashFunctionNameEnum.md5 request = ComputeDatasetHashTaskRequest( dataset_id=dataset_instance.dataset.id, extra_files_path=None, - hash_function=hash_funciton, + hash_function=hash_function, user=None, ) compute_dataset_hash.delay(request=request, task_user_id=getattr(trans.user, "id", None))