From 0f6f4392ba7c5f0613368f76dab6b766f9f2928f Mon Sep 17 00:00:00 2001 From: Szymon Szyszkowski Date: Wed, 13 Nov 2024 17:57:55 +0000 Subject: [PATCH] feat: get untrusted types from blob --- src/gentropy/method/l2g/model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gentropy/method/l2g/model.py b/src/gentropy/method/l2g/model.py index caa65f274..336efeb7f 100644 --- a/src/gentropy/method/l2g/model.py +++ b/src/gentropy/method/l2g/model.py @@ -63,7 +63,8 @@ def load_from_disk(cls: Type[LocusToGeneModel], path: str) -> LocusToGeneModel: client = storage.Client() bucket = storage.Bucket(client=client, name=bucket_name) blob = storage.Blob(name=blob_name, bucket=bucket) - loaded_model = sio.loads(blob.download_as_string(client=client)) + data = blob.download_as_string(client=client) + loaded_model = sio.loads(data, trusted=sio.get_untrusted_types(data=data)) else: loaded_model = sio.load(path, trusted=sio.get_untrusted_types(file=path))