UNSAFE_LOAD

CompileSeen in: The editor

What happened

Some ways of reading a file, such as pickle, run whatever code the file carries. Forge does not allow them in a strategy or a library, in any function. Writing data that way is not refused.

What to do

Read data with numpy, pandas or json from a file listed in assets.

Example

text
strategy.py, line 11: `pickle.load` can run code hidden in the data it reads, so Forge does not allow it. Read data with numpy, pandas or json from a file listed in assets. [UNSAFE_LOAD]

The wording of the message depends on your file, and the code does not. An error stops the file from loading.

Ask about this in the forum