Skip to content

Commit

Permalink
Add string cast for dbkey / genome_build
Browse files Browse the repository at this point in the history
pydantic v1 would automatically apply the string casting.
I've verified that we raise RequestParameterInvlalid for new requests.
  • Loading branch information
mvdbeek committed May 23, 2024
1 parent eef864a commit ccec683
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/galaxy/managers/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,8 @@ def add_serializers(self):
# 'extended_metadata': self.serialize_extended_metadata,
# 'extended_metadata_id': self.serialize_id,
# remapped
"genome_build": lambda item, key, **context: item.dbkey,
# TODO: Replace string cast with https://github.com/pydantic/pydantic/pull/9137 on 24.1
"genome_build": lambda item, key, **context: str(item.dbkey) if item.dbkey is not None else None,
# derived (not mapped) attributes
"data_type": lambda item, key, **context: f"{item.datatype.__class__.__module__}.{item.datatype.__class__.__name__}",
"converted": self.serialize_converted_datasets,
Expand Down

0 comments on commit ccec683

Please sign in to comment.