-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UntrustedTypesFoundException raised for standard library usage in lightgbm's Booster #432
Comments
|
Thank you for the quick reply, here is a minimal example with lightgbm:
For my understanding did I understand it correctly, that the trusted objects are recursively checked further for untrusted data? |
Thanks for the reproducer.
Yes, trusting a "parent" type doesn't mean children included in that type are all trusted. |
I encountered a bug(?) regarding import collections
import skops.io as sio
class MyClass:
def __init__(self):
self.default_dict = collections.defaultdict(set)
self.default_dict['key-0'] = set(['foo'])
my_obj = MyClass()
print('my_obj: ', my_obj.default_dict)
sio.dump(my_obj, 'dump.skops')
my_obj_loaded = sio.load('dump.skops', trusted=['__main__.MyClass', 'collections.defaultdict'])
print('my_obj_loaded: ', my_obj_loaded.default_dict) # There is no default value
my_obj_loaded.default_dict['key-1'] # So this line raises "KeyError: 'key-1'" The output of this code is
This occurs also when using also I used skops.io 0.10.0 on Python 3.12.4. |
So one thing: I checked and this is not a regression really, with the latest lightgbm, |
Yes, it seems not the new version introduced the issue. Version 0.9.0 could work if you used
But this is not possible since 0.10.0 Anyway thank you for the quick fix! |
Hello there,
after updating to 0.10.0 we got the following error:
In the serialised object we only have a single
lightgbm.basic.Booster
object.The text was updated successfully, but these errors were encountered: