diff --git a/lib/galaxy/managers/datasets.py b/lib/galaxy/managers/datasets.py index 612a69989deb..1bbe86ee7021 100644 --- a/lib/galaxy/managers/datasets.py +++ b/lib/galaxy/managers/datasets.py @@ -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,