gesistsa / rio

🐟 A Swiss-Army Knife for Data I/O
http://gesistsa.github.io/rio/
600 stars 76 forks source link

`trust` argument of `import()` #432

Closed lobin-xx closed 3 months ago

lobin-xx commented 3 months ago

Hey!

Just to let you know I got such warning while using import (Windows 11; R.4.4.0; rio 1.1.1)

df <- rio::import(file.path(ROOT_DATA_DIR,'my_df.rds')) Warning message: The trust argument of import() should be explicit for serialization formats as of rio 1.0.3. ℹ Missing trust will be set to FALSE by default for RDS in 2.0.0. ℹ The deprecated feature was likely used in the rio package. Please report the issue at https://github.com/gesistsa/rio/issues. This warning is displayed once every 8 hours. Call lifecycle::last_lifecycle_warnings() to see where this warning was generated.

Best!Lobin

chainsawriot commented 3 months ago

@lobin-xx That's a feature. See #406 . There is a security risk of importing serialization files, so we must ensure that you trust your RDS.

https://gesistsa.github.io/rio/news/index.html#rio-103

You can either say you trust your RDS, i.e. df <- rio::import(file.path(ROOT_DATA_DIR,'my_df.rds', 'my_df.rds'), trust = TRUE).

Or you can change the option.

options(rio.import.trust = TRUE) ## put this to .Rprofile, if you dare.
df <- rio::import(file.path(ROOT_DATA_DIR,'my_df.rds'))
lobin-xx commented 3 months ago

Thanks a lot!